Merge branch 'master' into 'master'

fix embeds and statements

See merge request Hiroyuki/communityrelations!1
merge-requests/17/head
Hiroyuki 2021-02-14 19:19:09 -05:00
commit cf0a386520
1 changed files with 4 additions and 18 deletions

View File

@ -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 = <TextChannel>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 = <TextChannel>this.server.client.getChannel('807444198969835550');