Compare commits

..

2 Commits

2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ const schema_post = validator.object({
// MARK: UPDATE products // MARK: UPDATE products
const schema_patch = validator const schema_patch = validator
.object({ .object({
id: validator.number().positive().precision(0), id: validator.number().positive().precision(0).required(),
gtin: validator gtin: validator
.string() .string()
.min(8) .min(8)

View File

@ -95,7 +95,7 @@ async function post(req: Request, res: Response) {
.create({ .create({
data: { data: {
name: value.name, name: value.name,
code: value.code code: (value.code === '0000') ? null : value.code
}, },
select: { select: {
id: true id: true