feat: deal create, update, delete

This commit is contained in:
2025-08-24 12:49:19 +04:00
parent 10f50ac254
commit d5be9ce61a
23 changed files with 741 additions and 76 deletions

View File

@ -120,7 +120,7 @@ const useCrudOperations = <
});
};
const onDelete = (entity: TEntity) => {
const onDelete = (entity: TEntity, onSuccess?: () => void) => {
modals.openConfirmModal({
title: getDeleteConfirmTitle(entity),
children: (
@ -130,6 +130,7 @@ const useCrudOperations = <
confirmProps: { color: "red" },
onConfirm: () => {
deleteMutation.mutate({ path: { pk: entity.id } } as any);
onSuccess && onSuccess();
setEntities(prev => prev.filter(e => e.id !== entity.id));
},
});