From 6a7990e722789afde820c49475a8368a4b3662c7 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Thu, 15 Jan 2026 11:59:25 +0700 Subject: [PATCH] fix: make suppliers optional --- .../product/form/ProductForm.schema.ts | 1 - .../master-data/product/form/ProductForm.tsx | 23 +++++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/pages/master-data/product/form/ProductForm.schema.ts b/src/components/pages/master-data/product/form/ProductForm.schema.ts index b85d5d4c..8a1d3de2 100644 --- a/src/components/pages/master-data/product/form/ProductForm.schema.ts +++ b/src/components/pages/master-data/product/form/ProductForm.schema.ts @@ -92,7 +92,6 @@ export const ProductFormSchema: Yup.ObjectSchema = .typeError('Harga wajib diisi!'), }) ) - .min(1, 'Minimal harus ada 1 supplier!') .required('Supplier wajib diisi!'), flags: Yup.array() diff --git a/src/components/pages/master-data/product/form/ProductForm.tsx b/src/components/pages/master-data/product/form/ProductForm.tsx index 7e893f67..8c04d594 100644 --- a/src/components/pages/master-data/product/form/ProductForm.tsx +++ b/src/components/pages/master-data/product/form/ProductForm.tsx @@ -527,6 +527,7 @@ const ProductForm = ({ type = 'add', initialValues }: ProductFormProps) => { idx )} isClearable + isDisabled={type === 'detail'} className={{ wrapper: 'min-w-48 w-full', }} @@ -573,16 +574,18 @@ const ProductForm = ({ type = 'add', initialValues }: ProductFormProps) => { -
- -
+ {type !== 'detail' && ( +
+ +
+ )} )}