+
diff --git a/src/features/group/UpdateGroupUser/index.tsx b/src/features/group/UpdateGroupUser/index.tsx
index a11c606f..dc350dd1 100644
--- a/src/features/group/UpdateGroupUser/index.tsx
+++ b/src/features/group/UpdateGroupUser/index.tsx
@@ -19,6 +19,7 @@ export const UpdateGroupUser = ({ groupId, user, onSuccess, onCancel }: UpdateGr
initialValues={getUpdateGroupUserInitialValues(user)}
mutationFunction={handleUpdateGroupUser}
onSuccess={onSuccess}
+ successMessage="User role was updated successfully"
keysInvalidateQueries={[[{ queryKey: [GroupQueryKey.GET_GROUP_USERS, groupId] }]]}
>
diff --git a/src/features/queue/CreateQueue/index.tsx b/src/features/queue/CreateQueue/index.tsx
index a44de7cc..9991f971 100644
--- a/src/features/queue/CreateQueue/index.tsx
+++ b/src/features/queue/CreateQueue/index.tsx
@@ -25,6 +25,7 @@ export const CreateQueue = ({ group }: CreateQueueProps) => {
mutationFunction={handleCreateQueue}
onSuccess={onSuccess}
+ successMessage="Queue was created successfully"
keysInvalidateQueries={[[{ queryKey: [QueueQueryKey.GET_QUEUES, group.id] }]]}
>
diff --git a/src/features/queue/UpdateQueue/index.tsx b/src/features/queue/UpdateQueue/index.tsx
index 26af4321..4d8199e9 100644
--- a/src/features/queue/UpdateQueue/index.tsx
+++ b/src/features/queue/UpdateQueue/index.tsx
@@ -27,6 +27,7 @@ export const UpdateQueue = ({ queue, group }: UpdateQueueProps) => {
mutationFunction={handleUpdateQueue}
initialValues={getUpdateQueueInitialValues(queue)}
onSuccess={onSuccess}
+ successMessage="Queue was updated successfully"
keysInvalidateQueries={[
[{ queryKey: [QueueQueryKey.GET_QUEUES, group.id] }],
[{ queryKey: [QueueQueryKey.GET_QUEUE, queue.id] }],
diff --git a/src/shared/ui/ManagedForm/index.tsx b/src/shared/ui/ManagedForm/index.tsx
index 1fc3c917..5e403782 100644
--- a/src/shared/ui/ManagedForm/index.tsx
+++ b/src/shared/ui/ManagedForm/index.tsx
@@ -13,6 +13,7 @@ export const ManagedForm = ({
children,
mutationFunction,
onSuccess,
+ successMessage,
keysInvalidateQueries = [],
isHiddenLoadingOnSuccess = false,
onError = () => undefined,
@@ -35,6 +36,11 @@ export const ManagedForm = ({
if (isHiddenLoadingOnSuccess) {
setLoading(false);
}
+ if (successMessage) {
+ notification.success({
+ message: successMessage,
+ });
+ }
},
onError: (error) => {
onError(error);
diff --git a/src/shared/ui/ManagedForm/types.ts b/src/shared/ui/ManagedForm/types.ts
index 3a4075f8..6071ff01 100644
--- a/src/shared/ui/ManagedForm/types.ts
+++ b/src/shared/ui/ManagedForm/types.ts
@@ -12,6 +12,8 @@ export interface ManagedFormProps extends Omit, 'form' | 'onF
mutationFunction: (params: T) => Promise;
/** Callback on success response from request */
onSuccess: (response: R) => void;
+ /** Notification message text on success response from request */
+ successMessage?: string;
/** Callback on error response from request */
onError?: (error: unknown) => void;
/** Keys for invalidate cache of other requests */
diff --git a/src/widgets/transfer/CreateTransfer/index.tsx b/src/widgets/transfer/CreateTransfer/index.tsx
index 85c5c93c..109d45b5 100644
--- a/src/widgets/transfer/CreateTransfer/index.tsx
+++ b/src/widgets/transfer/CreateTransfer/index.tsx
@@ -27,6 +27,7 @@ export const CreateTransfer = ({ group }: CreateTransferProps) => {
initialValues={CREATE_TRANSFER_INITIAL_VALUES}
mutationFunction={handleCreateTransfer}
onSuccess={onSuccess}
+ successMessage="Transfer was created successfully"
keysInvalidateQueries={[[{ queryKey: [TransferQueryKey.GET_TRANSFERS, group.id] }]]}
>
diff --git a/src/widgets/transfer/UpdateTransfer/index.tsx b/src/widgets/transfer/UpdateTransfer/index.tsx
index 43b6bbdf..0712f7ef 100644
--- a/src/widgets/transfer/UpdateTransfer/index.tsx
+++ b/src/widgets/transfer/UpdateTransfer/index.tsx
@@ -27,6 +27,7 @@ export const UpdateTransfer = ({ transfer, group }: UpdateTransferProps) => {
initialValues={transferInitialValues}
mutationFunction={handleUpdateTransfer}
onSuccess={onSuccess}
+ successMessage="Transfer was updated successfully"
keysInvalidateQueries={[
[{ queryKey: [TransferQueryKey.GET_TRANSFERS, group.id] }],
[{ queryKey: [TransferQueryKey.GET_TRANSFER, transfer.id] }],