fix(FE): fix delete reseponse project flock

This commit is contained in:
randy-ar
2025-12-31 12:25:08 +07:00
parent 84eb34a9dd
commit 6cd09a413d
@@ -228,11 +228,18 @@ const ProjectFlockTable = ({ refresh }: { refresh?: () => void }) => {
const confirmationModalDeleteClickHandler = async () => {
setIsDeleteLoading(true);
await ProjectFlockApi.delete(selectedSingleRow?.id as number);
const response = await ProjectFlockApi.delete(
selectedSingleRow?.id as number
);
if (isResponseSuccess(response)) {
toast.success(response?.message as string);
}
if (isResponseError(response)) {
toast.error(response?.message as string);
}
refreshProjectFlocks();
deleteModal.closeModal();
toast.success('Successfully delete Project Flock!');
setIsDeleteLoading(false);
setRowSelection({});
};