refactor(FE-62,63,65): refactor Movement and ProductWarehouse APIs, update MovementForm schema, and enhance MovementTable functionality

This commit is contained in:
rstubryan
2025-10-16 14:33:49 +07:00
parent aa21088e99
commit c6a0c542aa
7 changed files with 277 additions and 556 deletions
+7 -4
View File
@@ -7,6 +7,7 @@ interface TableRowOptionsProps {
recordId: string | number;
basePath: string;
onDelete?: () => void;
queryParam?: string;
}
export const TableRowOptions = ({
@@ -14,6 +15,7 @@ export const TableRowOptions = ({
recordId,
basePath,
onDelete,
queryParam = 'id',
}: TableRowOptionsProps) => (
<div
tabIndex={type === 'dropdown' ? 0 : undefined}
@@ -26,7 +28,7 @@ export const TableRowOptions = ({
)}
>
<Button
href={`${basePath}/detail/?id=${recordId}`}
href={`${basePath}/detail/?${queryParam}=${recordId}`}
variant='ghost'
color='primary'
className='justify-start text-sm'
@@ -35,12 +37,12 @@ export const TableRowOptions = ({
Detail
</Button>
<Button
href={`${basePath}/detail/edit/?id=${recordId}`}
href={`${basePath}/detail/edit/?${queryParam}=${recordId}`}
variant='ghost'
color='warning'
className='justify-start text-sm'
>
<Icon icon='material-symbols:edit-outline' width={16} height={16} />
<Icon icon='mdi:pencil-outline' width={16} height={16} />
Edit
</Button>
{onDelete && (
@@ -51,9 +53,10 @@ export const TableRowOptions = ({
className='text-error hover:text-inherit justify-start text-sm'
>
<Icon
icon='material-symbols:delete-outline-rounded'
icon='mdi:delete-outline'
width={16}
height={16}
className='justify-start text-sm'
/>
Delete
</Button>