changes to report
parent
4c012c9518
commit
5a7c3d7fdb
|
@ -217,7 +217,7 @@ export default class Report extends Route {
|
||||||
const merchant = await this.server.client.db.Merchant.findOne({ key: req.headers.authorization }).lean().exec();
|
const merchant = await this.server.client.db.Merchant.findOne({ key: req.headers.authorization }).lean().exec();
|
||||||
if (!merchant) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED });
|
if (!merchant) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED });
|
||||||
|
|
||||||
const report = await this.server.client.db.Score.findOne({ userID: req.body.userID }).lean().exec();
|
const report = await this.server.client.db.Score.findOne({ userID: req.body.userID, 'pin.2': req.body.pin }).lean().exec();
|
||||||
if (!report) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED });
|
if (!report) return res.status(401).json({ code: this.constants.codes.UNAUTHORIZED, message: this.constants.messages.UNAUTHORIZED });
|
||||||
|
|
||||||
let totalScore: number;
|
let totalScore: number;
|
||||||
|
|
Loading…
Reference in New Issue