diff --git a/backend/controllers/SuperuserController.js b/backend/controllers/SuperuserController.js index 09817a3b..bc7caa7a 100644 --- a/backend/controllers/SuperuserController.js +++ b/backend/controllers/SuperuserController.js @@ -1,3 +1,18 @@ +const Register = require('../models/schemas/RegistrationPeriod') + exports.openRegistrationPeriod = async (req, res) => { - + const { name, isOpen, start, end } = req.body; + + await Register.create({ + name: name, + isOpen: isOpen, + start: start, + end: end, + }).then(() => { + res.status(201).json("OK") + }).catch((err) => { + if(err){ + res.status(400).json({error: err}); + }; + }); } \ No newline at end of file