add historical data to score reports
parent
03ae4d8e61
commit
9ec5e00e89
|
@ -470,6 +470,8 @@ export default class Report extends Route {
|
||||||
|
|
||||||
const moderations = await this.server.client.db.Moderation.find({ userID: score.userID });
|
const moderations = await this.server.client.db.Moderation.find({ userID: score.userID });
|
||||||
|
|
||||||
|
const historical = await this.server.client.db.ScoreHistorical.find({ userID: score.userID }).lean().exec();
|
||||||
|
|
||||||
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
name: `${member.username}#${member.discriminator}`,
|
name: `${member.username}#${member.discriminator}`,
|
||||||
|
@ -487,6 +489,7 @@ export default class Report extends Route {
|
||||||
totalModerations: moderations?.length > 0 ? moderations.length : 0,
|
totalModerations: moderations?.length > 0 ? moderations.length : 0,
|
||||||
inquiries: score.inquiries?.length > 0 ? score.inquiries : [],
|
inquiries: score.inquiries?.length > 0 ? score.inquiries : [],
|
||||||
softInquiries: score.softInquiries?.length > 0 ? score.softInquiries : [],
|
softInquiries: score.softInquiries?.length > 0 ? score.softInquiries : [],
|
||||||
|
historical: historical ?? [],
|
||||||
lastUpdated: score.lastUpdate,
|
lastUpdated: score.lastUpdate,
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue