260228:1559 20260228:16:00 fix drawings pageSize and add reference_date to schema
Some checks failed
Build and Deploy / deploy (push) Failing after 52s
Some checks failed
Build and Deploy / deploy (push) Failing after 52s
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { DrawingCard } from '@/components/drawings/card';
|
|
||||||
import { useDrawings } from '@/hooks/use-drawing';
|
import { useDrawings } from '@/hooks/use-drawing';
|
||||||
import { Drawing } from '@/types/drawing';
|
|
||||||
import { Loader2 } from 'lucide-react';
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { PaginationState, SortingState } from '@tanstack/react-table';
|
import { PaginationState, SortingState } from '@tanstack/react-table';
|
||||||
import { ServerDataTable } from '@/components/documents/common/server-data-table';
|
import { ServerDataTable } from '@/components/documents/common/server-data-table';
|
||||||
@@ -32,12 +29,11 @@ export function DrawingList({ type, projectId, filters }: DrawingListProps) {
|
|||||||
const {
|
const {
|
||||||
data: response,
|
data: response,
|
||||||
isLoading,
|
isLoading,
|
||||||
isError,
|
|
||||||
} = useDrawings(type, {
|
} = useDrawings(type, {
|
||||||
projectId,
|
projectId,
|
||||||
...filters,
|
...filters,
|
||||||
page: pagination.pageIndex + 1, // API is 1-based
|
page: pagination.pageIndex + 1, // API is 1-based
|
||||||
pageSize: pagination.pageSize,
|
limit: pagination.pageSize,
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
const drawings = response?.data || [];
|
const drawings = response?.data || [];
|
||||||
|
|||||||
@@ -1045,7 +1045,9 @@ CREATE TABLE attachments (
|
|||||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'วันที่อัปโหลด',
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'วันที่อัปโหลด',
|
||||||
expires_at DATETIME NULL COMMENT 'เวลาหมดอายุของไฟล์ Temp',
|
expires_at DATETIME NULL COMMENT 'เวลาหมดอายุของไฟล์ Temp',
|
||||||
CHECKSUM VARCHAR(64) NULL COMMENT 'SHA-256 Checksum',
|
CHECKSUM VARCHAR(64) NULL COMMENT 'SHA-256 Checksum',
|
||||||
FOREIGN KEY (uploaded_by_user_id) REFERENCES users (user_id) ON DELETE CASCADE
|
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 = 'ตาราง "กลาง" เก็บไฟล์แนบทั้งหมดของระบบ';
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'ตาราง "กลาง" เก็บไฟล์แนบทั้งหมดของระบบ';
|
||||||
|
|
||||||
-- ตารางเชื่อม correspondences กับ attachments (M:N)
|
-- ตารางเชื่อม correspondences กับ attachments (M:N)
|
||||||
|
|||||||
Reference in New Issue
Block a user