feat(material): modify handlers and service of material
This commit is contained in:
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { z } from 'zod'
|
||||
import type { EquipmentMaterial } from '~/models/equipment-material'
|
||||
import type { Material } from '~/models/material'
|
||||
|
||||
const MaterialSchema = z.object({
|
||||
code: z.string({ required_error: 'Kode harus diisi' }).min(1, 'Kode minimum 1 karakter'),
|
||||
@@ -8,7 +8,7 @@ const MaterialSchema = z.object({
|
||||
stock: z.preprocess((val) => Number(val), z.number({ invalid_type_error: 'Stok harus berupa angka' }).min(1, 'Stok harus lebih besar dari 0')),
|
||||
})
|
||||
|
||||
type MaterialFormData = z.infer<typeof MaterialSchema> & EquipmentMaterial
|
||||
type MaterialFormData = z.infer<typeof MaterialSchema> & Material
|
||||
|
||||
export { MaterialSchema }
|
||||
export type { MaterialFormData }
|
||||
Reference in New Issue
Block a user