Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
lasyaneti committed Jan 17, 2024
1 parent 04d430c commit ee43726
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/services/admission/admission-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ admissionRouter.put("/update/", strongJwtVerification, async (req: Request, res:

const updateEntries: ApplicantDecisionFormat[] = req.body as ApplicantDecisionFormat[];
const ops = updateEntries.map((entry) => {
return Models.AdmissionDecision.findOneAndUpdate({ userId: entry.userId }, { $set: { status: entry.status, admittedPro: entry.admittedPro } });
return Models.AdmissionDecision.findOneAndUpdate(
{ userId: entry.userId },
{ $set: { status: entry.status, admittedPro: entry.admittedPro } },
);
});

try {
Expand Down Expand Up @@ -261,9 +264,14 @@ admissionRouter.get("/rsvp/", strongJwtVerification, async (_: Request, res: Res

//Filters data if caller doesn't have elevated perms
if (!hasElevatedPerms(payload)) {
return res
return res
.status(StatusCode.SuccessOK)
.send({ userId: queryResult.userId, status: queryResult.status, response: queryResult.response, admittedPro: queryResult.admittedPro });
.send({
userId: queryResult.userId,
status: queryResult.status,
response: queryResult.response,
admittedPro: queryResult.admittedPro,
});
}

return res.status(StatusCode.SuccessOK).send(queryResult);
Expand All @@ -272,7 +280,7 @@ admissionRouter.get("/rsvp/", strongJwtVerification, async (_: Request, res: Res
/**
* @api {get} /admission/rsvp/:USERID/ GET /admission/rsvp/:USERID/
* @apiGroup Admission
* @apiDescription Check RSVP decision for a given userId, provided that the authenticated user has elevated perms. If didn't apply pro, admittedPro field won't be part of the response.
* @apiDescription Check RSVP decision for a given userId, provided that the authenticated user has elevated perms. If didn't apply pro, admittedPro field won't be part of the response.
*
* @apiParam {String} USERID Id to pull the decision for
*
Expand Down

0 comments on commit ee43726

Please sign in to comment.