-router.post("/problems", access.logged, access.ajax, (req,res) => {
- const error = ProblemModel.checkProblem(req.body.prob);
- if (!!error)
- return res.json({errmsg:error});
- const problem =
- {
- vid: req.body.prob.vid,
- fen: req.body.prob.fen,
- uid: req.userId,
- instruction: sanitizeHtml(req.body.prob.instruction),
- solution: sanitizeHtml(req.body.prob.solution),
- };
- ProblemModel.create(problem, (err,ret) => {
- return res.json(err || {pid:ret.pid});
- });
-});
-