Compare commits
2 Commits
6844b1fb24
...
7b9fe95cd4
Author | SHA1 | Date | |
---|---|---|---|
7b9fe95cd4 | |||
09f06fb2ea |
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user