mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 07:15:44 +00:00
refactor(FE-435,436): Allow optional kandang and location expenses
This commit is contained in:
@@ -20,10 +20,10 @@ interface ExpenseKandangsTableProps {
|
||||
locationId?: number;
|
||||
type: 'add' | 'edit' | 'detail';
|
||||
selectedKandangs: {
|
||||
id: number;
|
||||
name: string;
|
||||
id?: number;
|
||||
name?: string;
|
||||
}[];
|
||||
onChange: (kandangs: { id: number; name: string }[]) => void;
|
||||
onChange: (kandangs: { id?: number; name?: string }[]) => void;
|
||||
className?: {
|
||||
wrapper?: string;
|
||||
};
|
||||
@@ -67,7 +67,11 @@ const ExpenseKandangsTable = ({
|
||||
);
|
||||
const [sorting, setSorting] = useState<SortingState>([]);
|
||||
const [rowSelection, setRowSelection] = useState<Record<string, boolean>>(
|
||||
convertRowSelectionArrToObj(selectedKandangs.map((item) => item.id))
|
||||
convertRowSelectionArrToObj(
|
||||
selectedKandangs
|
||||
.map((item) => item.id)
|
||||
.filter((id): id is number => id !== undefined)
|
||||
)
|
||||
);
|
||||
|
||||
const kandangsColumns: ColumnDef<Kandang>[] = [
|
||||
|
||||
Reference in New Issue
Block a user