大更新
This commit is contained in:
@@ -78,9 +78,17 @@ export default function WarehouseIndex({ warehouses, filters }: PageProps) {
|
||||
};
|
||||
|
||||
const handleDeleteWarehouse = (id: string) => {
|
||||
if (confirm("確定要停用此倉庫嗎?\n注意:刪除倉庫將連帶刪除所有庫存與紀錄!")) {
|
||||
router.delete(route('warehouses.destroy', id));
|
||||
}
|
||||
router.delete(route('warehouses.destroy', id), {
|
||||
onSuccess: () => {
|
||||
toast.success('倉庫已刪除');
|
||||
setEditingWarehouse(null);
|
||||
},
|
||||
onError: (errors: any) => {
|
||||
// If backend returns error bag or flash error
|
||||
// Flash error is handled by AuthenticatedLayout usually via usePage props.
|
||||
// But we can also check errors bag here if needed.
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const handleAddTransferOrder = () => {
|
||||
|
||||
Reference in New Issue
Block a user