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
const schema_patch = validator
.object({
id: validator.number().positive().precision(0),
id: validator.number().positive().precision(0).required(),
gtin: validator
.string()
.min(8)

View File

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