From 857ccc27363c2955ee15c6812685b0942d740ed3 Mon Sep 17 00:00:00 2001 From: haseeb Date: Sat, 13 Feb 2021 23:32:03 +0000 Subject: [PATCH] fix embeds and statements --- src/api/board.ins/routes/root.ts | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/api/board.ins/routes/root.ts b/src/api/board.ins/routes/root.ts index 93b1cbe..51e4881 100644 --- a/src/api/board.ins/routes/root.ts +++ b/src/api/board.ins/routes/root.ts @@ -29,14 +29,7 @@ export default class Root extends Route { }); } - if (!req.body.subject) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - if (!req.body.body) { + if (!req.body.subject || !req.body.body) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -60,7 +53,7 @@ export default class Root extends Route { embed.setColor('#dd3acd'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); - embed.addField('ID', executiveOrder.oID); + embed.setDescription(executiveOrder.oID); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550'); @@ -90,14 +83,7 @@ export default class Root extends Route { }); } - if (!req.body.subject) { - return res.status(400).json({ - code: this.constants.codes.CLIENT_ERROR, - message: this.constants.messages.CLIENT_ERROR, - }); - } - - if (!req.body.body) { + if (!req.body.subject || !req.body.body) { return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR, message: this.constants.messages.CLIENT_ERROR, @@ -115,7 +101,7 @@ export default class Root extends Route { embed.setColor('#66e1ff'); embed.addField('Subject', req.body.subject); embed.addField('Body', req.body.body); - embed.addField('ID', motionID); + embed.setDescription(motionID); embed.setTimestamp(new Date()); const channel = this.server.client.getChannel('807444198969835550');