Skip to content

Commit

Permalink
add success messages
Browse files Browse the repository at this point in the history
  • Loading branch information
N7Remus committed Nov 15, 2024
1 parent 2bb67dc commit 3885427
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/store/actions/managementActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export const deleteData = (id : number, serviceName:string): AppThunk<Promise<ob
data = await (await managementService).service(serviceName).remove(
id
);
dispatch(notificationsActions.enqueueNotification({
message: 'Delete successfull',
options: { variant: 'success' }
}));

} catch (error) {
if (error instanceof Error) {
Expand Down Expand Up @@ -119,6 +123,10 @@ export const createData = (params : object, serviceName:string): AppThunk<Promis
params
);

dispatch(notificationsActions.enqueueNotification({
message: 'Creation successfull',
options: { variant: 'success' }
}));
} catch (error) {
if (error instanceof Error) {
dispatch(notificationsActions.enqueueNotification({
Expand Down Expand Up @@ -147,6 +155,10 @@ export const patchData = (id : number, params : object, serviceName : string): A
params
);

dispatch(notificationsActions.enqueueNotification({
message: 'Modification successfull',
options: { variant: 'success' }
}));
} catch (error) {
if (error instanceof Error) {
dispatch(notificationsActions.enqueueNotification({
Expand Down

0 comments on commit 3885427

Please sign in to comment.