Commit 04124292 authored by antoine masson's avatar antoine masson
Browse files

v1.14c

code cleaning
parent 12a254f7
......@@ -4,7 +4,7 @@ const Survey = mongoose.model('Survey');
const GlobalOptions = mongoose.model('SurveyGlobalOptions');
exports.registerNewToken = async (req, res) => {
// try {
try {
const checkToken = await Token.checkExistingField('token', req.body.token);
if (checkToken) {
return res.status(201).json({
......@@ -31,9 +31,9 @@ exports.registerNewToken = async (req, res) => {
const newtoken = await token.save();
res.status(201).json({token:newtoken,message:"Token created",status: "OK"});
// } catch (err) {
// res.status(400).json({ message: err,status:"Error" });
// }
} catch (err) {
res.status(400).json({ message: err,status:"Error" });
}
};
exports.update_token = async (req, res) => {
......
Supports Markdown
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