update title
This commit is contained in:
@ -72,17 +72,20 @@ const AddDialog = () => {
|
||||
handleAddDialog(false);
|
||||
resetForm();
|
||||
reload();
|
||||
toast.success('Posto Adm created successfully!');
|
||||
toast.success('Postu Administrativo created successfully!');
|
||||
const createActivity = {
|
||||
module: 'Manage Posto Administrativo',
|
||||
description: `Create PostoAdms => ${formField.name}`,
|
||||
description: `Create Postu Administrativo => ${formField.name}`,
|
||||
action: 'C'
|
||||
};
|
||||
|
||||
doSaveLogActivity(createActivity);
|
||||
} else {
|
||||
toast.error('Failed to create Posto Adm. Please try again.');
|
||||
setAlert({ show: true, message: 'Failed to create Posto Adm. Please try again.' });
|
||||
toast.error('Failed to create Postu Administrativo. Please try again.');
|
||||
setAlert({
|
||||
show: true,
|
||||
message: 'Failed to create Postu Administrativo. Please try again.'
|
||||
});
|
||||
}
|
||||
},
|
||||
[formField]
|
||||
@ -102,7 +105,8 @@ const AddDialog = () => {
|
||||
// console.log(response?.data);
|
||||
setMunicipios(response?.data.list);
|
||||
} catch (error) {
|
||||
console.error('Error fetching municipios', error);
|
||||
console.error('Error fetching Municipio', error);
|
||||
setAlert({ show: true, message: 'Failed to get Municipio. Please try again.' });
|
||||
}
|
||||
};
|
||||
|
||||
@ -159,7 +163,7 @@ const AddDialog = () => {
|
||||
<div className="w-full">
|
||||
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label className="form-label flex items-center gap-1 max-w-56">
|
||||
Name<span className="text-red-500">*</span>
|
||||
Postu Administrativo Name<span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
className="input"
|
||||
@ -179,7 +183,7 @@ const AddDialog = () => {
|
||||
<PopoverTrigger asChild>
|
||||
<button type="button" className="input col-span-5 text-left">
|
||||
{municipios.find((municipio) => municipio.id === formField.municipio_id)
|
||||
?.name || 'Select Municipios'}
|
||||
?.name || 'Select Municipio'}
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
@ -187,7 +191,7 @@ const AddDialog = () => {
|
||||
onWheel={(e) => e.stopPropagation()}
|
||||
>
|
||||
<Command>
|
||||
<CommandInput placeholder="Search Municipios..." />
|
||||
<CommandInput placeholder="Search Municipio..." />
|
||||
<CommandList className="max-h-[300px] overflow-y-auto pointer-events-auto">
|
||||
<CommandEmpty>No Municipio found.</CommandEmpty>
|
||||
<CommandGroup>
|
||||
|
||||
@ -28,7 +28,7 @@ const DeleteDialog = () => {
|
||||
|
||||
const doDeletePostoAdm = useCallback(async () => {
|
||||
if (!selectedPostoAdms) {
|
||||
toast.error('No Posto Adm selected');
|
||||
toast.error('No Postu Administrativo selected');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -39,18 +39,18 @@ const DeleteDialog = () => {
|
||||
if (response?.status) {
|
||||
setAlert({ show: false, message: '' });
|
||||
handleDeleteDialog(false, null);
|
||||
toast.success('Success Delete Posto Adm');
|
||||
toast.success('Success Delete Postu Administrativo');
|
||||
reload();
|
||||
const createActivity = {
|
||||
module: 'Manage Posto Administrativo',
|
||||
description: `Delete PostoAdms => ${selectedPostoAdms}`,
|
||||
module: 'Manage Postu Administrativo',
|
||||
description: `Delete Postu Administrativo => ${selectedPostoAdms}`,
|
||||
action: 'D'
|
||||
};
|
||||
|
||||
doSaveLogActivity(createActivity);
|
||||
} else {
|
||||
setAlert({ show: true, message: response?.message });
|
||||
toast.error('Failed Delete Posto Adm');
|
||||
toast.error('Failed Delete Postu Administrativo');
|
||||
}
|
||||
}, [selectedPostoAdms, DeleteData, handleDeleteDialog, reload]);
|
||||
|
||||
|
||||
@ -71,19 +71,22 @@ const EditDialog = () => {
|
||||
if (response?.status) {
|
||||
handleEditDialog(false, null);
|
||||
resetForm();
|
||||
toast.success('Success Update Posto Adm');
|
||||
toast.success('Success Update Postu Administrativo');
|
||||
reload();
|
||||
|
||||
const createActivity = {
|
||||
module: 'Manage Posto Administrativo',
|
||||
description: `Edit PostoAdms => ${selectedPostoAdms}`,
|
||||
module: 'Manage Postu Administrativo',
|
||||
description: `Edit Postu Administrativo => ${selectedPostoAdms}`,
|
||||
action: 'U'
|
||||
};
|
||||
|
||||
doSaveLogActivity(createActivity);
|
||||
} else {
|
||||
toast.error('Error Update Posto Adm');
|
||||
setAlert({ show: true, message: 'Failed to update posto adm. Please try again.' });
|
||||
toast.error('Error Update Postu Administrativo');
|
||||
setAlert({
|
||||
show: true,
|
||||
message: 'Failed to update Postu Administrativo Please try again.'
|
||||
});
|
||||
}
|
||||
},
|
||||
[selectedPostoAdms, formField]
|
||||
@ -103,7 +106,8 @@ const EditDialog = () => {
|
||||
// console.log('MUNICIPIOS: ', response?.data);
|
||||
setMunicipios(response?.data.list);
|
||||
} catch (error) {
|
||||
console.error('Error fetching municipios', error);
|
||||
console.error('Error fetching Municipio', error);
|
||||
setAlert({ show: true, message: 'Failed to get Municipio. Please try again.' });
|
||||
}
|
||||
}, []);
|
||||
|
||||
@ -169,7 +173,7 @@ const EditDialog = () => {
|
||||
<Dialog open={showEditDialog} onOpenChange={(open) => handleEditDialog(open, null)}>
|
||||
<DialogContent className="container-fixed max-w-[768px] flex flex-col p-5 overflow-hidden">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Posto Adm - Update</DialogTitle>
|
||||
<DialogTitle>Postu Administrativo - Update</DialogTitle>
|
||||
<DialogDescription></DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogBody>
|
||||
@ -185,7 +189,7 @@ const EditDialog = () => {
|
||||
<div className="w-full">
|
||||
<div className="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
|
||||
<label className="form-label flex items-center gap-1 max-w-56">
|
||||
Name<span className="text-red-500">*</span>
|
||||
Postu Administrativo Name<span className="text-red-500">*</span>
|
||||
</label>
|
||||
<Input
|
||||
className="input"
|
||||
@ -205,12 +209,12 @@ const EditDialog = () => {
|
||||
<PopoverTrigger asChild>
|
||||
<button type="button" className="input col-span-5 text-left">
|
||||
{municipios.find((municipio) => municipio.id === formField.municipio_id)
|
||||
?.name || 'Select Municipios'}
|
||||
?.name || 'Select Municipio'}
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-[400px] p-0">
|
||||
<Command>
|
||||
<CommandInput placeholder="Search Municipios..." />
|
||||
<CommandInput placeholder="Search Municipio..." />
|
||||
<CommandList>
|
||||
<CommandEmpty>No Municipio found.</CommandEmpty>
|
||||
<CommandGroup>
|
||||
|
||||
@ -16,7 +16,7 @@ const ListToolbar = () => {
|
||||
<KeenIcon icon="magnifier" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search Postu"
|
||||
placeholder="Search Postu Administrativo"
|
||||
value={(table.getColumn('name')?.getFilterValue() as string) ?? ''}
|
||||
onChange={(event) => table.getColumn('name')?.setFilterValue(event.target.value)}
|
||||
/>
|
||||
|
||||
@ -88,7 +88,7 @@ const ManagePostoAdmsContextProvider = ({ children }: { children: React.ReactNod
|
||||
id: 'name',
|
||||
// accessorKey: 'PostoAdms_name',
|
||||
header: ({ column }) => (
|
||||
<DataGridColumnHeader title="Posto Administrativo Name" column={column} />
|
||||
<DataGridColumnHeader title="Postu Administrativo Name" column={column} />
|
||||
),
|
||||
enableSorting: true,
|
||||
enableHiding: false,
|
||||
@ -99,7 +99,7 @@ const ManagePostoAdmsContextProvider = ({ children }: { children: React.ReactNod
|
||||
{
|
||||
accessorFn: (row) => row.municipios_name,
|
||||
id: 'municipios_name',
|
||||
header: ({ column }) => <DataGridColumnHeader title="Municipios Name" column={column} />,
|
||||
header: ({ column }) => <DataGridColumnHeader title="Municipio Name" column={column} />,
|
||||
enableSorting: false,
|
||||
enableHiding: false,
|
||||
meta: {
|
||||
|
||||
Reference in New Issue
Block a user