add endpoint for pgp /pgp/:userID
parent
fc03ce6b66
commit
86994430c2
|
@ -29,5 +29,15 @@ export default class Keys extends Route {
|
|||
message: memberDoc.x509,
|
||||
});
|
||||
});
|
||||
|
||||
this.router.get('/pgp/:userID', async (req, res) => {
|
||||
const memberDoc = await this.server.client.db.Member.findOne({ userID: req.params.userID }).lean().exec();
|
||||
const member = this.mainGuild.members.get(req.params.userID);
|
||||
if (!member || !memberDoc || !memberDoc?.pgp) return res.status(404).json({ code: this.constants.codes.NOT_FOUND, message: this.constants.messages.NOT_FOUND });
|
||||
return res.status(200).json({
|
||||
code: this.constants.codes.SUCCESS,
|
||||
message: memberDoc.pgp,
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue