add activity dialog on master data module

This commit is contained in:
Wikzyy
2025-04-07 15:20:35 +07:00
parent 61211e7e16
commit 5e719eefa2
21 changed files with 190 additions and 39 deletions

View File

@ -31,6 +31,7 @@ import {
CommandList
} from '@/components/ui/command';
import { NumericFormat } from 'react-number-format';
import { doSaveLogActivity } from '@/actions/GlobalActions';
interface GroupProps {
ID: string;
@ -48,7 +49,7 @@ interface WalletProps {
const API_URL_WALLET = apiConfig.service_wallet;
const AddDialog = () => {
const { showAddDialog, handleAddDialog } = useManageWalletRuleContext();
const { showAddDialog, handleAddDialog, selectedWalletRule } = useManageWalletRuleContext();
const { reload } = useDataGrid();
const { PostData, GetData } = useCallApi();
const [open, setOpen] = useState(false);
@ -94,6 +95,14 @@ const AddDialog = () => {
handleAddDialog(false);
toast.success('Success Create Wallet Rule');
reload();
const createActivity = {
module: 'Manage Wallet Rule',
description: `Create Wallet Rule => ${selectedWalletRule?.ID}`,
action: 'C'
};
doSaveLogActivity(createActivity);
} else {
toast.error('Failed Create Wallet Rule');
setAlert({ show: true, message: 'Failed Create Wallet Rule' });