mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 05:22:02 +00:00
refactor(FE-114): enforce required usage amount in RecordingForm validation
This commit is contained in:
@@ -48,7 +48,7 @@ export const RecordingFormSchema = Yup.object({
|
||||
.min(1, 'Produk wajib diisi!')
|
||||
.typeError('Produk harus berupa angka!'),
|
||||
usage_amount: Yup.number()
|
||||
.optional()
|
||||
.required('Jumlah penggunaan wajib diisi!')
|
||||
.min(0, 'Jumlah penggunaan tidak boleh negatif!')
|
||||
.typeError('Jumlah penggunaan harus berupa angka!'),
|
||||
notes: Yup.string().optional(),
|
||||
|
||||
@@ -903,6 +903,7 @@ const RecordingForm = ({ type = 'add', initialValues }: RecordingFormProps) => {
|
||||
</td>
|
||||
<td>
|
||||
<NumberInput
|
||||
required
|
||||
name={`stocks.${idx}.usage_amount`}
|
||||
value={stock.usage_amount || 0}
|
||||
onChange={formik.handleChange}
|
||||
|
||||
Reference in New Issue
Block a user