Skip to content

Commit

Permalink
fix: correct lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Emnaghz committed Oct 2, 2024
1 parent 90b06c4 commit 8cc6cee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frontend/src/hooks/useToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
enqueueSnackbar,
SnackbarProvider as ToastProvider,
} from "notistack";

import { useTranslation } from "react-i18next";

export { ToastProvider };
Expand Down Expand Up @@ -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");
Expand All @@ -54,6 +52,7 @@ export const useToast = () => {
toast: {
error: (error: any, options?: OptionsObject<"error">) => {
const errorMessage = extractErrorMessage(error);

enqueueSnackbar(errorMessage, {
variant: "error",
...options,
Expand Down

0 comments on commit 8cc6cee

Please sign in to comment.