From 436f29e73eb54df07e66c17c757fee313221a259 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 27 Oct 2020 16:55:47 -0400 Subject: [PATCH] fixes --- src/api/comm.libraryofcode.org/routes/report.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/comm.libraryofcode.org/routes/report.ts b/src/api/comm.libraryofcode.org/routes/report.ts index b42f2c1..ee14cdd 100644 --- a/src/api/comm.libraryofcode.org/routes/report.ts +++ b/src/api/comm.libraryofcode.org/routes/report.ts @@ -285,6 +285,8 @@ export default class Report extends Route { const member = await this.server.client.db.Score.findOne({ userID: req.body.userID, 'pin.2': req.body.pin }).lean().exec(); if (!member) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED }); + const mem = this.server.client.util.resolveMember(member.userID, this.server.client.guilds.get(this.server.client.config.guildID)); + if (!mem) return res.status(404).json({ code: this.constants.codes.NOT_FOUND, message: this.constants.codes.NOT_FOUND }); let totalScore: number; @@ -297,7 +299,6 @@ export default class Report extends Route { const embed = new RichEmbed(); embed.setTitle('Inquiry Notification'); embed.setColor('#00FFFF'); - const mem = this.server.client.util.resolveMember(member.userID, this.server.client.guilds.get(this.server.client.config.guildID)); embed.addField('Member', `${mem.user.username}#${mem.user.discriminator} | <@${member.userID}>`, true); embed.addField('Type', 'SOFT', true); embed.addField('Department/Service', merchant.name.toUpperCase(), true);