fix postoadms

This commit is contained in:
Wikzyy
2025-03-13 14:49:35 +07:00
parent 4eaccf2472
commit 07918aafed
3 changed files with 28 additions and 15 deletions

View File

@ -9,8 +9,9 @@ import { useNavigate, useParams } from 'react-router';
import ListToolbar from '../blocks/ListToolbar';
interface PostoAdmsProps {
id: number;
name: string;
posto_adms_id: number;
posto_adms_name: string;
municipios_name: string;
}
interface ContextProps {
@ -82,7 +83,7 @@ const ManagePostoAdmsContextProvider = ({ children }: { children: React.ReactNod
const columns = useMemo<ColumnDef<any>[]>(
() => [
{
accessorFn: (row) => row.id,
accessorFn: (row) => row.posto_adms_id,
id: 'id',
header: ({ column }) => <DataGridColumnHeader title="ID" column={column} />,
enableSorting: true,
@ -92,8 +93,8 @@ const ManagePostoAdmsContextProvider = ({ children }: { children: React.ReactNod
}
},
{
accessorFn: (row) => row.name,
id: 'name',
accessorFn: (row) => row.posto_adms_name,
id: 'posto_adms_name',
header: ({ column }) => (
<DataGridColumnHeader title="Posto Administrativo Name" column={column} />
),
@ -103,6 +104,16 @@ const ManagePostoAdmsContextProvider = ({ children }: { children: React.ReactNod
headerClassName: 'w-[1000px]'
}
},
{
accessorFn: (row) => row.municipios_name,
id: 'municipios_name',
header: ({ column }) => <DataGridColumnHeader title="Municipio Name" column={column} />,
enableSorting: true,
enableHiding: false,
meta: {
headerClassName: 'w-[1000px]'
}
},
{
id: 'actions',
header: ({ column }) => <DataGridColumnHeader title="Actions" column={column} />,