From 599b66503db6f0b7a3e1871d1b96803366a5be61 Mon Sep 17 00:00:00 2001 From: Kirill Date: Wed, 27 May 2026 22:07:01 +0500 Subject: [PATCH] style: fix import order and prettier formatting --- client/src/shared/lib/use-mutation-with-toast.ts | 14 ++++++++++++-- .../ui/NotificationStack/NotificationStack.tsx | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/client/src/shared/lib/use-mutation-with-toast.ts b/client/src/shared/lib/use-mutation-with-toast.ts index ccb98f9..44b7c30 100644 --- a/client/src/shared/lib/use-mutation-with-toast.ts +++ b/client/src/shared/lib/use-mutation-with-toast.ts @@ -18,13 +18,23 @@ export function useMutationWithToast { + onSuccess: ( + data: TData, + variables: TVariables, + onMutateResult: TOnMutateResult, + mutationContext: MutationFunctionContext, + ) => { if (successMessage) { addNotification({ type: 'success', message: successMessage }) } onSuccess?.(data, variables, onMutateResult, mutationContext) }, - onError: (error: TError, variables: TVariables, onMutateResult: TOnMutateResult | undefined, mutationContext: MutationFunctionContext) => { + onError: ( + error: TError, + variables: TVariables, + onMutateResult: TOnMutateResult | undefined, + mutationContext: MutationFunctionContext, + ) => { addNotification({ type: 'error', message: getApiErrorMessage(error) }) onError?.(error, variables, onMutateResult, mutationContext) }, diff --git a/client/src/shared/ui/NotificationStack/NotificationStack.tsx b/client/src/shared/ui/NotificationStack/NotificationStack.tsx index 696c0f0..9d48710 100644 --- a/client/src/shared/ui/NotificationStack/NotificationStack.tsx +++ b/client/src/shared/ui/NotificationStack/NotificationStack.tsx @@ -1,6 +1,6 @@ -import { useUnit } from 'effector-react' -import { Snackbar, Alert, Stack, IconButton } from '@mui/material' import CloseIcon from '@mui/icons-material/Close' +import { Snackbar, Alert, Stack, IconButton } from '@mui/material' +import { useUnit } from 'effector-react' import { $notifications, dismissNotification as dismissNotificationEvent } from '../../model/notification' export function NotificationStack() {