Skip to content

Commit

Permalink
backend abertura de matrícula
Browse files Browse the repository at this point in the history
  • Loading branch information
yaskisoba committed Dec 13, 2023
1 parent 32ad3eb commit adb8b7c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion backend/controllers/SuperuserController.js
Original file line number Diff line number Diff line change
@@ -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});
};
});
}

0 comments on commit adb8b7c

Please sign in to comment.