diff --git a/frontend/components/drawings/list.tsx b/frontend/components/drawings/list.tsx index f88adf5..1ab789f 100644 --- a/frontend/components/drawings/list.tsx +++ b/frontend/components/drawings/list.tsx @@ -1,9 +1,6 @@ 'use client'; -import { DrawingCard } from '@/components/drawings/card'; import { useDrawings } from '@/hooks/use-drawing'; -import { Drawing } from '@/types/drawing'; -import { Loader2 } from 'lucide-react'; import { useState } from 'react'; import { PaginationState, SortingState } from '@tanstack/react-table'; import { ServerDataTable } from '@/components/documents/common/server-data-table'; @@ -32,12 +29,11 @@ export function DrawingList({ type, projectId, filters }: DrawingListProps) { const { data: response, isLoading, - isError, } = useDrawings(type, { projectId, ...filters, page: pagination.pageIndex + 1, // API is 1-based - pageSize: pagination.pageSize, + limit: pagination.pageSize, } as any); const drawings = response?.data || []; diff --git a/specs/03-Data-and-Storage/lcbp3-v1.8.0-schema.sql b/specs/03-Data-and-Storage/lcbp3-v1.8.0-schema.sql index 3447e64..53bf092 100644 --- a/specs/03-Data-and-Storage/lcbp3-v1.8.0-schema.sql +++ b/specs/03-Data-and-Storage/lcbp3-v1.8.0-schema.sql @@ -1044,8 +1044,10 @@ CREATE TABLE attachments ( uploaded_by_user_id INT NOT NULL COMMENT 'ผู้อัปโหลดไฟล์', created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'วันที่อัปโหลด', expires_at DATETIME NULL COMMENT 'เวลาหมดอายุของไฟล์ Temp', - CHECKSUM VARCHAR(64) NULL COMMENT 'SHA -256 Checksum', - FOREIGN KEY (uploaded_by_user_id) REFERENCES users (user_id) ON DELETE CASCADE + CHECKSUM VARCHAR(64) NULL COMMENT 'SHA-256 Checksum', + reference_date DATE NULL COMMENT 'Date used for folder structure (e.g. Issue Date) to prevent broken paths', + FOREIGN KEY (uploaded_by_user_id) REFERENCES users (user_id) ON DELETE CASCADE, + INDEX idx_attachments_reference_date (reference_date) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'ตาราง "กลาง" เก็บไฟล์แนบทั้งหมดของระบบ'; -- ตารางเชื่อม correspondences กับ attachments (M:N)