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

@ -22,6 +22,7 @@ import {
} from '@/components/ui/select';
import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox';
import { doSaveLogActivity } from '@/actions/GlobalActions';
interface CurrencyProps {
ID: string;
@ -42,7 +43,7 @@ const API_URL_WALLET = apiConfig.service_wallet;
const API_URL_MASTER_DATA = apiConfig.service_master_data;
const AddDialog = () => {
const { showAddDialog, handleAddDialog } = useManageWalletContext();
const { showAddDialog, handleAddDialog, selectedWallet } = useManageWalletContext();
const { GetData, PostData } = useCallApi();
const { reload } = useDataGrid();
const [alert, setAlert] = useState({
@ -101,6 +102,14 @@ const AddDialog = () => {
handleAddDialog(false);
toast.success('Success Create Wallet');
reload();
const createActivity = {
module: 'Manage Wallet',
description: `Create Wallet => ${selectedWallet?.Wallet_id} - ${selectedWallet?.Wallet_name}`,
action: 'C'
};
doSaveLogActivity(createActivity);
} else {
toast.error('Failed Create Wallet');
setAlert({ show: true, message: 'Failed Create Wallet' });