From 0cdbff69546d9c68b94c04c4ebf906d6e26d7c4a Mon Sep 17 00:00:00 2001 From: rstubryan Date: Sat, 17 Jan 2026 12:32:55 +0700 Subject: [PATCH] refactor(FE): Validate recording date and handle null location --- .../pages/production/recording/form/RecordingForm.schema.ts | 1 + .../pages/production/recording/form/RecordingForm.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/pages/production/recording/form/RecordingForm.schema.ts b/src/components/pages/production/recording/form/RecordingForm.schema.ts index 59d5ac43..82b59036 100644 --- a/src/components/pages/production/recording/form/RecordingForm.schema.ts +++ b/src/components/pages/production/recording/form/RecordingForm.schema.ts @@ -103,6 +103,7 @@ export const RecordingGrowingFormSchema: Yup.ObjectSchema { // ===== EVENT HANDLERS ===== const locationChangeHandler = (val: OptionType | OptionType[] | null) => { const location = val as OptionType | null; - const locationId = Number(location?.value); + const locationId = location ? Number(location.value) : 0; formik.setFieldTouched('location', true); formik.setFieldValue('location', location);