mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 05:22:02 +00:00
fix: set DailyChecklist.kandang optional
This commit is contained in:
@@ -136,7 +136,7 @@ export function ListDailyChecklistContent() {
|
||||
|
||||
const handleEdit = (item: DailyChecklist) => {
|
||||
const formattedDate = new Date(item.date).toISOString().split('T')[0];
|
||||
const kandangId = item.kandang.id;
|
||||
const kandangId = item.kandang?.id ?? '';
|
||||
const category = item.category;
|
||||
|
||||
router.push(
|
||||
@@ -335,7 +335,7 @@ export function ListDailyChecklistContent() {
|
||||
accessorKey: 'kandang',
|
||||
header: 'Kandang',
|
||||
enableSorting: false,
|
||||
cell: ({ row }) => row.original.kandang.name,
|
||||
cell: ({ row }) => row.original.kandang?.name ?? '-',
|
||||
},
|
||||
{
|
||||
accessorKey: 'category',
|
||||
@@ -627,7 +627,7 @@ export function ListDailyChecklistContent() {
|
||||
<div className='flex justify-between text-sm'>
|
||||
<span className='text-gray-600'>Kandang:</span>
|
||||
<span className='font-medium text-gray-900'>
|
||||
{selectedItem.kandang.name}
|
||||
{selectedItem.kandang?.name ?? '-'}
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex justify-between text-sm'>
|
||||
@@ -687,7 +687,7 @@ export function ListDailyChecklistContent() {
|
||||
<div className='flex justify-between text-sm'>
|
||||
<span className='text-gray-600'>Kandang:</span>
|
||||
<span className='font-medium text-gray-900'>
|
||||
{selectedItem.kandang.name}
|
||||
{selectedItem.kandang?.name ?? '-'}
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex justify-between text-sm'>
|
||||
@@ -760,7 +760,7 @@ export function ListDailyChecklistContent() {
|
||||
<div className='flex justify-between text-sm'>
|
||||
<span className='text-gray-600'>Kandang:</span>
|
||||
<span className='font-medium text-gray-900'>
|
||||
{selectedItem.kandang.name}
|
||||
{selectedItem.kandang?.name ?? '-'}
|
||||
</span>
|
||||
</div>
|
||||
<div className='flex justify-between text-sm'>
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ export function DetailDailyChecklistContent() {
|
||||
const checklistData = {
|
||||
id: rawDetailChecklist?.id,
|
||||
date: rawDetailChecklist?.date,
|
||||
kandang_id: rawDetailChecklist?.kandang.id,
|
||||
kandang_id: rawDetailChecklist?.kandang?.id,
|
||||
category: rawDetailChecklist?.category,
|
||||
status: rawDetailChecklist?.status,
|
||||
reject_reason: rawDetailChecklist?.reject_reason,
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ export type BaseDailyChecklist = {
|
||||
status: string;
|
||||
category: string;
|
||||
date: string;
|
||||
kandang: Pick<BaseKandang, 'id' | 'name' | 'status' | 'capacity'>;
|
||||
kandang?: Pick<BaseKandang, 'id' | 'name' | 'status' | 'capacity'>;
|
||||
total_phase: number;
|
||||
total_activity: number;
|
||||
progress: number;
|
||||
|
||||
Reference in New Issue
Block a user