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

@ -15,13 +15,14 @@ import {
} from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { doSaveLogActivity } from '@/actions/GlobalActions';
const API_URL = apiConfig.service_master_data;
const AddDialog = () => {
const parentRef = useRef<any | null>(null);
const { reload } = useDataGrid();
const { PostData } = useCallApi();
const { showAddDialog, handleAddDialog } = useManageProfessionContext();
const { showAddDialog, handleAddDialog, selectedProfession } = useManageProfessionContext();
const parsedUser = getAuth()?.user;
const [alert, setAlert] = useState({
show: false,
@ -53,6 +54,14 @@ const AddDialog = () => {
handleAddDialog(false);
toast.success('Success Create Profession');
reload();
const createActivity = {
module: 'Manage Profession',
description: `Create Profession => ${selectedProfession}`,
action: 'C'
};
doSaveLogActivity(createActivity);
} else {
toast.error('Failed Create Profession');
setAlert({ show: true, message: response?.message });