fixing manage user & add field customer
This commit is contained in:
@ -23,6 +23,7 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue
|
||||
} from '@/components/ui/select';
|
||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||
|
||||
const API_URL = apiConfig.service_master_data;
|
||||
|
||||
@ -75,6 +76,13 @@ const AddDialog = () => {
|
||||
resetForm();
|
||||
reload();
|
||||
toast.success('Reward Create successfully!');
|
||||
const createActivity = {
|
||||
module: 'Manage Reward',
|
||||
description: `Create New Reward => ${formField.name}`,
|
||||
action: 'C'
|
||||
};
|
||||
|
||||
doSaveLogActivity(createActivity);
|
||||
} else {
|
||||
toast.error('Failed to create reward.');
|
||||
setAlert({ show: true, message: 'Failed to create reward. Please try again.' });
|
||||
|
||||
@ -13,6 +13,7 @@ import {
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { DialogDescription } from '@radix-ui/react-dialog';
|
||||
import { useManageRewardContext } from '../hooks/useManageRewardContext';
|
||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||
|
||||
const API_URL = apiConfig.service_master_data;
|
||||
|
||||
@ -42,6 +43,13 @@ const DeleteDialog = () => {
|
||||
handleDeleteDialog(false, null);
|
||||
toast.success('Success Delete Reward');
|
||||
reload();
|
||||
const deleteActivity = {
|
||||
module: 'Manage Reward',
|
||||
description: `Delete Reward => ${selectedReward}`,
|
||||
action: 'D'
|
||||
};
|
||||
|
||||
doSaveLogActivity(deleteActivity);
|
||||
} else {
|
||||
setAlert({ show: true, message: response?.message });
|
||||
toast.error('Failed Delete Reward');
|
||||
|
||||
@ -23,6 +23,7 @@ import {
|
||||
SelectValue
|
||||
} from '@/components/ui/select';
|
||||
import { useManageRewardContext } from '../hooks/useManageRewardContext';
|
||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||
|
||||
const API_URL = apiConfig.service_master_data;
|
||||
|
||||
@ -74,6 +75,13 @@ const EditDialog = () => {
|
||||
handleEditDialog(false, null);
|
||||
toast.success('Success Update Reward');
|
||||
reload();
|
||||
const editActivity = {
|
||||
module: 'Manage Reward',
|
||||
description: `Edit Reward => ${formField.name}`,
|
||||
action: 'U'
|
||||
};
|
||||
|
||||
doSaveLogActivity(editActivity);
|
||||
} else {
|
||||
toast.error('Error Update Reward');
|
||||
setAlert({ show: true, message: 'Failed to Update Reward. Please try again.' });
|
||||
|
||||
Reference in New Issue
Block a user