diff --git a/src/components/pages/purchase/form/PurchaseRequestForm.schema.ts b/src/components/pages/purchase/form/PurchaseRequestForm.schema.ts index ebd0792d..8a84b3f4 100644 --- a/src/components/pages/purchase/form/PurchaseRequestForm.schema.ts +++ b/src/components/pages/purchase/form/PurchaseRequestForm.schema.ts @@ -106,7 +106,10 @@ export const PurchaseRequestFormSchema: Yup.ObjectSchema 0); + }) .typeError('Area wajib diisi!'), location: Yup.object({ value: Yup.number().min(1).required(), @@ -114,7 +117,10 @@ export const PurchaseRequestFormSchema: Yup.ObjectSchema 0); + }) .typeError('Lokasi wajib diisi!'), credit_term: Yup.number() .required('Termin kredit wajib diisi!') diff --git a/src/components/pages/purchase/form/PurchaseRequestForm.tsx b/src/components/pages/purchase/form/PurchaseRequestForm.tsx index 0f7b7225..dce21146 100644 --- a/src/components/pages/purchase/form/PurchaseRequestForm.tsx +++ b/src/components/pages/purchase/form/PurchaseRequestForm.tsx @@ -543,7 +543,7 @@ const PurchaseRequestForm = ({ onInputChange={setAreaSelectInputValue} isLoading={isLoadingAreas} isError={ - formik.touched.area_id && Boolean(formik.errors.area_id) + formik.touched.area && Boolean(formik.errors.area_id) } errorMessage={formik.errors.area_id as string} isDisabled={type === 'detail'} @@ -564,8 +564,7 @@ const PurchaseRequestForm = ({ onInputChange={setLocationSelectInputValue} isLoading={isLoadingLocations} isError={ - formik.touched.location_id && - Boolean(formik.errors.location_id) + formik.touched.location && Boolean(formik.errors.location_id) } errorMessage={formik.errors.location_id as string} isDisabled={type === 'detail' || !formik.values.area_id}