diff --git a/README.md b/README.md index 696a1f221ed2e9535bb469e28af6b7bbe43551e0..84470984b279191099440f6120dec3650037e2c7 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ -# 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` diff --git a/backend/routes/auth.js b/backend/routes/auth.js index 3a40dbfb80e9b0d26ff02e6aa08537cc1b7431e5..a4fa60e3bf5f0bc161b30844766a3450fe75a9b9 100644 --- a/backend/routes/auth.js +++ b/backend/routes/auth.js @@ -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;