From 8cc6cee6b5ca8f27ea7cfa91e56d89dc236c6092 Mon Sep 17 00:00:00 2001 From: Emnaghz Date: Wed, 2 Oct 2024 16:43:10 +0100 Subject: [PATCH] fix: correct lint errors --- frontend/src/hooks/useToast.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/hooks/useToast.ts b/frontend/src/hooks/useToast.ts index 1f8f82c..f9aa165 100644 --- a/frontend/src/hooks/useToast.ts +++ b/frontend/src/hooks/useToast.ts @@ -10,7 +10,6 @@ import { enqueueSnackbar, SnackbarProvider as ToastProvider, } from "notistack"; - import { useTranslation } from "react-i18next"; export { ToastProvider }; @@ -41,7 +40,6 @@ const TOAST_WARNING_STYLE = { export const useToast = () => { const { t } = useTranslation(); - const extractErrorMessage = (error: any) => { if (error?.statusCode == 409) { return t("message.duplicate_error"); @@ -54,6 +52,7 @@ export const useToast = () => { toast: { error: (error: any, options?: OptionsObject<"error">) => { const errorMessage = extractErrorMessage(error); + enqueueSnackbar(errorMessage, { variant: "error", ...options,