Skip to content

Commit

Permalink
add dossier messages for solo issue/del
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcoombs2000 committed Aug 15, 2024
1 parent 849f9ef commit 88b0ec4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion controllers/TrainingController.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,13 @@ async (req, res) => {
if (pos === 'APP' || pos === 'CTR')
await axios.post(`https://api.vatusa.net/v2/solo?cid=${req.params.id}&position=${req.body.position}&expDate=${req.body.expDate}&apikey=${process.env.VATUSA_API_KEY}`)

await req.app.dossier.create({
by: res.user.cid,
affected: req.params.cid,
action: `%b issued a Solo Certificate for ` + req.body.position + ` for %a.`
});


return res.json(res.stdRes);
} catch(e) {
req.app.Sentry.captureException(e);
Expand Down Expand Up @@ -474,7 +481,14 @@ async (req, res) => {
towersoloExpiration: '',
soloPosition: ''
});
return res.json(res.stdRes);

await req.app.dossier.create({
by: res.user.cid,
affected: req.params.cid,
action: `%b deleted a Solo Certificate for ` + req.body.position + ` for %a.`
});

return res.json(res.stdRes);
} catch(e) {
req.app.Sentry.captureException(e);
res.stdRes.ret_det = e;
Expand Down

0 comments on commit 88b0ec4

Please sign in to comment.