From 93d4ff93391e03434cad38e9de8308fe03e32bec Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Wed, 18 Mar 2026 00:13:18 +0700 Subject: [PATCH 1/3] fix: search stock product issue correctly --- .../pages/production/recording/form/RecordingForm.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/pages/production/recording/form/RecordingForm.tsx b/src/components/pages/production/recording/form/RecordingForm.tsx index c9236d19..0d62fd0b 100644 --- a/src/components/pages/production/recording/form/RecordingForm.tsx +++ b/src/components/pages/production/recording/form/RecordingForm.tsx @@ -603,10 +603,11 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { const { options: stockProductOptions, + setInputValue: setStockProductInputValue, rawData: stockProducts, isLoadingOptions: isLoadingStockProducts, loadMore: loadMoreStockProducts, - } = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', '', { + } = useSelect(ProductWarehouseApi.basePath, 'id', 'product.name', 'search', { flags: 'PAKAN,OVK', location_id: stockProductsLocationId, kandang_id: stockProductsKandangId, @@ -2665,6 +2666,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => { product.value === stock.product_warehouse_id ) || null } + onInputChange={setStockProductInputValue} onChange={(selectedOption) => { const option = selectedOption as OptionType | null; From 8bf5a88edb1f66880fcfe85ada2ef996322058f9 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Thu, 26 Mar 2026 16:19:55 +0700 Subject: [PATCH 2/3] fix: do not redirect to SSO when the error response status is 401 and API url is refresh API --- src/services/http/client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/http/client.ts b/src/services/http/client.ts index 68b5282a..42e71978 100644 --- a/src/services/http/client.ts +++ b/src/services/http/client.ts @@ -10,7 +10,10 @@ const axiosClient = axios.create({ baseURL: BASE_URL, timeout: 10_000 }); axiosClient.interceptors.response.use( (response) => response, (error: AxiosError) => { - if (error.response?.status === 401) { + if ( + error.response?.status === 401 && + error.config?.url !== '/sso/refresh' + ) { redirectToSSO(); } From f5d9dcbdf65377f13e65405e416bcd54c5c77593 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Fri, 27 Mar 2026 11:12:58 +0700 Subject: [PATCH 3/3] fix: set DailyChecklist.kandang optional --- .../list-daily-checklist/ListDailyChecklistContent.tsx | 10 +++++----- .../detail/DetailDailyChecklistContent.tsx | 2 +- src/types/api/daily-checklist/daily-checklist.d.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx b/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx index e6127cf0..01e567d3 100644 --- a/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx +++ b/src/figma-make/components/pages/list-daily-checklist/ListDailyChecklistContent.tsx @@ -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() {
Kandang: - {selectedItem.kandang.name} + {selectedItem.kandang?.name ?? '-'}
@@ -687,7 +687,7 @@ export function ListDailyChecklistContent() {
Kandang: - {selectedItem.kandang.name} + {selectedItem.kandang?.name ?? '-'}
@@ -760,7 +760,7 @@ export function ListDailyChecklistContent() {
Kandang: - {selectedItem.kandang.name} + {selectedItem.kandang?.name ?? '-'}
diff --git a/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx b/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx index 88f04a80..c9d8d21d 100644 --- a/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx +++ b/src/figma-make/components/pages/list-daily-checklist/detail/DetailDailyChecklistContent.tsx @@ -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, diff --git a/src/types/api/daily-checklist/daily-checklist.d.ts b/src/types/api/daily-checklist/daily-checklist.d.ts index 5e5a3fe8..5c9cae07 100644 --- a/src/types/api/daily-checklist/daily-checklist.d.ts +++ b/src/types/api/daily-checklist/daily-checklist.d.ts @@ -12,7 +12,7 @@ export type BaseDailyChecklist = { status: string; category: string; date: string; - kandang: Pick; + kandang?: Pick; total_phase: number; total_activity: number; progress: number;