Added "approved by" system
This commit is contained in:
@@ -16,10 +16,11 @@ ur.use(requireLogin)
|
||||
ur.post('/', [requireRole(["17th Command", "17th Administrator", "17th HQ"]), requireMemberState(MemberState.Member)], async (req: express.Request, res: express.Response) => {
|
||||
try {
|
||||
const change = req.body.promotions as BatchPromotionMember[];
|
||||
const approver = req.body.approver as number;
|
||||
const author = req.user.id;
|
||||
if (!change) res.sendStatus(400);
|
||||
|
||||
await batchInsertMemberRank(change, author);
|
||||
await batchInsertMemberRank(change, author, approver);
|
||||
logger.info('app', 'Promotion batch submitted', { author: author })
|
||||
res.sendStatus(201);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user