fixes
parent
082876e377
commit
7dc57d6c7b
|
@ -36,11 +36,11 @@ export default class Webhook extends Route {
|
||||||
if (!req.query?.id) return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR });
|
if (!req.query?.id) return res.status(400).json({ code: this.constants.codes.CLIENT_ERROR });
|
||||||
|
|
||||||
const account = await this.server.client.db.Account.findOne({ userID: req.query.id.toString() }).lean().exec();
|
const account = await this.server.client.db.Account.findOne({ userID: req.query.id.toString() }).lean().exec();
|
||||||
if (!account) return res.status(200).send({ error: true });
|
if (!account) return res.status(200).send({ found: false });
|
||||||
const moderations = await this.server.client.db.Moderation.find({ userID: req.query.id.toString() }).lean().exec();
|
const moderations = await this.server.client.db.Moderation.find({ userID: req.query.id.toString() }).lean().exec();
|
||||||
|
|
||||||
const response: {
|
const response: {
|
||||||
error: boolean,
|
found: boolean,
|
||||||
tier: number,
|
tier: number,
|
||||||
totalReferrals?: number,
|
totalReferrals?: number,
|
||||||
createdAt?: Date,
|
createdAt?: Date,
|
||||||
|
@ -48,7 +48,7 @@ export default class Webhook extends Route {
|
||||||
locks?: Date[],
|
locks?: Date[],
|
||||||
deletes?: Date[],
|
deletes?: Date[],
|
||||||
} = {
|
} = {
|
||||||
error: false,
|
found: true,
|
||||||
tier: account.tier,
|
tier: account.tier,
|
||||||
totalReferrals: 0,
|
totalReferrals: 0,
|
||||||
createdAt: account.createdAt,
|
createdAt: account.createdAt,
|
||||||
|
|
Loading…
Reference in New Issue