Commit 5d18f1b7 by Иван Кубота

parse tags

parent 40606314
......@@ -296,9 +296,16 @@ module.exports = {
fn: async function (args) {
// sub my completed attempt
return await asyncPool(`select * from quiz
return (await asyncPool(`select * from quiz
left join quiz_position on quiz_position.quiz_id = quiz.id
WHERE user_position_id=(SELECT position_id from users WHERE id=?) and end_date>=CURDATE();`, [args.userID]);
WHERE user_position_id=(SELECT position_id from users WHERE id=?) and end_date>=CURDATE() && start_date<=CURDATE();`, [args.userID])).map(q=>{
try{
q.tags = JSON.parse(q.tags);
}catch (e) {
console.error('Can not parse tags');
}
return q;
});
}
},
'/api/quiz/notCompleted/:userID': {
......
Markdown is supported
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