From c0691b0ab848e20ccd4c73c8c4731c426242f969 Mon Sep 17 00:00:00 2001 From: abdou6666 Date: Fri, 17 Jan 2025 19:46:12 +0100 Subject: [PATCH] fix: remove delete opearation --- .../src/components/media-library/index.tsx | 29 +------------------ 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/frontend/src/components/media-library/index.tsx b/frontend/src/components/media-library/index.tsx index 4409cd44..5ee442d7 100644 --- a/frontend/src/components/media-library/index.tsx +++ b/frontend/src/components/media-library/index.tsx @@ -47,7 +47,6 @@ type MediaLibraryProps = { export const MediaLibrary = ({ onSelect, accept }: MediaLibraryProps) => { const { t } = useTranslate(); const { toast } = useToast(); - const deleteDialogCtl = useDialog(false); const formatFileSize = useFormattedFileSize(); const { onSearch, searchPayload } = useSearch({ $iLike: ["name"], @@ -77,26 +76,7 @@ export const MediaLibrary = ({ onSelect, accept }: MediaLibraryProps) => { }, }, ); - const { mutateAsync: deleteCategory } = useDelete(EntityType.ATTACHMENT, { - onError: () => { - toast.error(t("message.internal_server_error")); - }, - onSuccess: () => { - deleteDialogCtl.closeDialog(); - toast.success(t("message.item_delete_success")); - }, - }); - const actionColumns = useActionColumns( - EntityType.ATTACHMENT, - [ - { - label: ActionColumnLabel.Delete, - action: (row) => deleteDialogCtl.openDialog(row.id), - requires: [PermissionAction.DELETE], - }, - ], - t("label.operations"), - ); + const columns: GridColDef[] = [ { field: "id", headerName: "ID" }, { @@ -169,17 +149,10 @@ export const MediaLibrary = ({ onSelect, accept }: MediaLibraryProps) => { valueGetter: (params) => t("datetime.updated_at", getDateTimeFormatter(params)), }, - actionColumns, ]; return ( - { - if (deleteDialogCtl?.data) deleteCategory(deleteDialogCtl.data); - }} - />