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

@ -72,7 +72,7 @@ const AddDialog = () => {
toast.success('Sucos created successfully!');
const createActivity = {
module: 'Manage Sucos',
description: `Create Sucos => ${selectedSucos}`,
description: `Create Suco => ${selectedSucos}`,
action: 'C'
};

View File

@ -4,8 +4,16 @@ import { useCallback, useState } from 'react';
import { useCallApi } from '@/hooks';
import { Alert, useDataGrid } from '@/components';
import { toast } from 'sonner';
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle
} from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
import { doSaveLogActivity } from '@/actions/GlobalActions';
const API_URL = apiConfig.service_master_data;
@ -31,6 +39,13 @@ const DeleteDialog = () => {
handleDeleteDialog(false, null);
toast.success('Success Delete Sucos');
reload();
const createActivity = {
module: 'Manage Sucos',
description: `Edit Suco => ${selectedSucos}`,
action: 'D'
};
doSaveLogActivity(createActivity);
} else {
setAlert({ show: true, message: response?.message });
toast.error('Failed Delete Sucos');

View File

@ -79,7 +79,7 @@ const EditDialog = () => {
reload();
const createActivity = {
module: 'Manage Sucos',
description: `Edit Sucos => ${selectedSucos}`,
description: `Edit Suco => ${selectedSucos}`,
action: 'U'
};