add create activity on 4 modules: Provider, Conversion, Menu, Currency

This commit is contained in:
bagusajisaputroo
2025-04-07 16:17:00 +07:00
parent 5e719eefa2
commit 10937bceeb
12 changed files with 114 additions and 11 deletions

View File

@ -32,6 +32,7 @@ import {
CommandItem,
CommandList
} from '@/components/ui/command';
import { doSaveLogActivity } from '@/actions/GlobalActions';
const API_URL_CUSTOMER = apiConfig.service_customer;
const API_URL_MASTERDATA = apiConfig.service_master_data;
@ -82,6 +83,13 @@ const EditDialog = () => {
resetForm();
handleEditDialog(false, null);
toast.success('Provider updated successfully.');
const createActivity = {
module: 'Manage Provider',
description: `Update Provider => ${selectedProvider}`,
action: 'U'
};
doSaveLogActivity(createActivity);
reload();
} else {
toast.error('Failed to update provider.');
@ -308,11 +316,11 @@ const EditDialog = () => {
</label>
<Popover open={open} onOpenChange={setOpen}>
<PopoverTrigger asChild>
<button
type="button"
className="input col-span-5 text-left"
style={{ color: 'inherit' }}
>
<button
type="button"
className="input col-span-5 text-left"
style={{ color: 'inherit' }}
>
{customers.find((customer) => customer.id === formField.agent)
?.fullname || 'Select Agent'}
</button>