add activity dialog on municipios, postoadm, sucos, and aldeias
This commit is contained in:
@ -24,6 +24,7 @@ import {
|
||||
CommandItem,
|
||||
CommandList
|
||||
} from '@/components/ui/command';
|
||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||
|
||||
interface SucosProps {
|
||||
sucos_id: number;
|
||||
@ -34,7 +35,7 @@ const API_URL = apiConfig.service_master_data;
|
||||
|
||||
const AddDialog = () => {
|
||||
const parentRef = useRef<any | null>(null);
|
||||
const { showAddDialog, handleAddDialog } = useManageAldeiasContext();
|
||||
const { showAddDialog, handleAddDialog, selectedAldeias } = useManageAldeiasContext();
|
||||
const { reload } = useDataGrid();
|
||||
const { PostData, GetData } = useCallApi();
|
||||
const parsedUser = getAuth()?.user;
|
||||
@ -70,6 +71,13 @@ const AddDialog = () => {
|
||||
handleAddDialog(false);
|
||||
toast.success('Success Create Aldeias');
|
||||
reload();
|
||||
const createActivity = {
|
||||
module: 'Manage Aldeias',
|
||||
description: `Create Aldeias => ${selectedAldeias}`,
|
||||
action: 'C'
|
||||
};
|
||||
|
||||
doSaveLogActivity(createActivity);
|
||||
} else {
|
||||
toast.error('Error Create Aldeias');
|
||||
setAlert({ show: true, message: 'Failed to create Aldeias. Please try again.' });
|
||||
|
||||
@ -24,6 +24,7 @@ import {
|
||||
CommandItem,
|
||||
CommandList
|
||||
} from '@/components/ui/command';
|
||||
import { doSaveLogActivity } from '@/actions/GlobalActions';
|
||||
|
||||
interface SucosProps {
|
||||
sucos_id: number;
|
||||
@ -69,6 +70,13 @@ const EditDialog = () => {
|
||||
handleEditDialog(false, null);
|
||||
toast.success('Success Update Aldeias');
|
||||
reload();
|
||||
const createActivity = {
|
||||
module: 'Manage Aldeias',
|
||||
description: `Edit Aldeias => ${selectedAldeias}`,
|
||||
action: 'U'
|
||||
};
|
||||
|
||||
doSaveLogActivity(createActivity);
|
||||
} else {
|
||||
toast.error('Error Update Aldeias');
|
||||
setAlert({ show: true, message: 'Error Update Aldeias' });
|
||||
|
||||
Reference in New Issue
Block a user