mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE-65): update DeliveryObjectSchema to enforce minimum delivery costs of 1
This commit is contained in:
@@ -58,11 +58,11 @@ const DeliveryProductObjectSchema = Yup.object({
|
|||||||
const DeliveryObjectSchema: Yup.ObjectSchema<DeliverySchema> = Yup.object({
|
const DeliveryObjectSchema: Yup.ObjectSchema<DeliverySchema> = Yup.object({
|
||||||
delivery_cost: Yup.number()
|
delivery_cost: Yup.number()
|
||||||
.required('Biaya pengiriman wajib diisi!')
|
.required('Biaya pengiriman wajib diisi!')
|
||||||
.min(0, 'Biaya minimal 0!')
|
.min(1, 'Biaya minimal 1!')
|
||||||
.typeError('Biaya harus berupa angka!'),
|
.typeError('Biaya harus berupa angka!'),
|
||||||
delivery_cost_per_item: Yup.number()
|
delivery_cost_per_item: Yup.number()
|
||||||
.transform((value) => (isNaN(value) ? undefined : value))
|
.transform((value) => (isNaN(value) ? undefined : value))
|
||||||
.min(0, 'Biaya per item minimal 0!')
|
.min(1, 'Biaya per item minimal 1!')
|
||||||
.typeError('Biaya per item harus berupa angka!'),
|
.typeError('Biaya per item harus berupa angka!'),
|
||||||
document_index: Yup.number().optional(),
|
document_index: Yup.number().optional(),
|
||||||
document: Yup.mixed<File | string>()
|
document: Yup.mixed<File | string>()
|
||||||
|
|||||||
Reference in New Issue
Block a user