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

v1.13

- Answers in token are erased only if status is modified to new (not if it was new before)
parent c27906c9
......@@ -88,10 +88,11 @@ exports.get_a_token = async (req, res) => {
exports.update_a_token = async (req, res) => {
try {
const token = await Token.findOne({ _id: req.params.id });
let oldstatus=token.status;
for (key in req.body) {
token[key] = req.body[key];
}
if(token.status==='new'){
if(token.status==='new'&&oldstatus!=='new'){
token.answers=null
token.submitedAt=null
}
......
{
"name": "api",
"version": "1.1.2",
"version": "1.1.3",
"description": "",
"main": "index.js",
"scripts": {
......
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