feat (material): update validation of attribute stock

This commit is contained in:
riefive
2025-09-03 15:39:06 +07:00
parent 6afa968b7b
commit 3c74a123ac
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ const schema = z.object({
code: z.string().min(1, 'Code must be at least 1 characters long'),
name: z.string().min(1, 'Name must be at least 1 characters long'),
type: z.string(),
stock: z.preprocess((val) => Number(val), z.number({ invalid_type_error: 'Stok harus berupa angka' })),
stock: z.preprocess((val) => Number(val), z.number({ invalid_type_error: 'Stock must be a number' }).min(1)),
})
function onClick(type: string) {