Skip to content
Snippets Groups Projects
Commit cd21a731 authored by FALKE JANOS's avatar FALKE JANOS :island:
Browse files

Merge branch 'develop' into 'main'

:sparkles: change README and auth.js

See merge request !6
parents 5c002d94 3a48ad9a
Branches
1 merge request!6:sparkles: change README and auth.js
Pipeline #68571 passed with stage
# Partie Student - ERP 2021
# Student Part - ERP 2021
### Baptiste Cerdan, Victor Vogt, Thomas Steinmetz, Janos Falke
## Baptiste CERDAN, Victor VOGT, Thomas STEINMETZ, Janos FALKE
## REST endpoints
Features the following REST endpoints:
- **/api/signup**
- **/api/login**
- **/api/pay_adhesion**
- **/api/me**
- **/api/me/update**
## Development
- Run `npm start`, server will run at `http://localhost:8005` and MongoDB `http://localhost:27017`
......@@ -141,24 +141,4 @@ router.post('/me/update', passport.authenticate('jwt', {session: false}), async
res.status(200).json();
});
router.post('/pay_adhesion', passport.authenticate('jwt', {session: false}), async function(req, res, next) {
const student_number = req.body.student_number;
if (!student_number)
return res.status(400);
const dbUser = await User.findOne({student_number: req.body.student_number});
if (student_number)
dbUser.date_subscription = new Date();
try {
await dbUser.save();
} catch (e) {
return res.status(400).json(e);
}
res.status(200).json();
});
module.exports = router;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment