add activity dialog on master data module
This commit is contained in:
@ -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' });
|
||||
|
||||
Reference in New Issue
Block a user