Skip to content

Commit

Permalink
Merge pull request #249 from oslokommune/develop
Browse files Browse the repository at this point in the history
feat/rest: minor fix
  • Loading branch information
aulonm authored Mar 18, 2021
2 parents e5046c3 + 6fcf573 commit 9fbdb80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions functions/backend/routes/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ const collection = db.collection('requestAccess');

router.post('/:email/create', param('email').isEmail().trim().escape().normalizeEmail(), async (req, res) => {
const sanitized = matchedData(req);
const { id } = sanitized;
const { email } = sanitized;

try {
await collection.add({ email: id, created: new Date() });
await collection.add({ email, created: new Date() });

res.send(`Access request created (${id})`);
res.send(`Access request created (${email})`);
} catch (e) {
res.status(500).send(`Cannot create access request (${id}}`);
res.status(500).send(`Cannot create access request (${email}}`);
}
});

Expand Down

0 comments on commit 9fbdb80

Please sign in to comment.