refactor(FE): Use name_with_periode in HppPerKandang cell

This commit is contained in:
rstubryan
2026-01-19 20:57:16 +07:00
parent 67f7a68f1b
commit cbc54eb501
3 changed files with 4 additions and 2 deletions
@@ -562,8 +562,8 @@ const HppPerKandangTab = () => {
header: 'Kandang', header: 'Kandang',
accessorKey: 'kandang.name', accessorKey: 'kandang.name',
cell: (props) => { cell: (props) => {
const kandang = props.row.original.kandang; const row = props.row.original;
return kandang?.name || '-'; return row.name_with_periode || row.kandang?.name || '-';
}, },
footer: () => <div className='font-semibold text-gray-900'>ALL</div>, footer: () => <div className='font-semibold text-gray-900'>ALL</div>,
}, },
+1
View File
@@ -10,6 +10,7 @@ export type BaseProjectFlockKandang = {
kandang_id: number; kandang_id: number;
kandang: Kandang; kandang: Kandang;
project_flock: ProjectFlock; project_flock: ProjectFlock;
name_with_period?: string;
approval: BaseApproval; approval: BaseApproval;
chickins?: Chickin[]; chickins?: Chickin[];
available_qtys?: AvailableQty[]; available_qtys?: AvailableQty[];
+1
View File
@@ -5,6 +5,7 @@ import { Kandang } from '@/types/api/master-data/kandang';
export type HppPerKandangRow = { export type HppPerKandangRow = {
id: number; id: number;
kandang: Kandang; kandang: Kandang;
name_with_periode?: string;
weight_range: { weight_range: {
weight_min: number; weight_min: number;
weight_max: number; weight_max: number;