From 113d7c5dc15df3ae5415a354bc513b3a291f6ab6 Mon Sep 17 00:00:00 2001 From: Stefan080106 Date: Mon, 17 Apr 2023 22:28:54 +0200 Subject: [PATCH] fix(validation) --- src/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/index.js b/src/index.js index 3e4248b..c5f9b2c 100644 --- a/src/index.js +++ b/src/index.js @@ -168,6 +168,11 @@ app.post('/depesche', async (req, res) => { } console.log("[INFO] Received print request"); + + if (req.body.foreign_id == "") { + req.body.foreign_id = "undefined" + } + let value = {} try { value = await schema.validateAsync(req.body, { allowUnknown: true }); @@ -181,6 +186,7 @@ app.post('/depesche', async (req, res) => { } + await main(value).catch( (err) => { console.log(err);