*/
const ProblemModel = {
+
checkProblem: function(p) {
return (
p.id.toString().match(/^[0-9]+$/) &&
safeRemove: function(id, uid, devs) {
db.serialize(function() {
- let whereClause = "WHERE id = " + prob.id;
+ let whereClause = "WHERE id = " + id;
if (!devs.includes(uid)) whereClause += " AND uid = " + uid;
const query =
"DELETE FROM Problems " +
whereClause;
db.run(query);
});
- },
-}
+ }
+
+};
module.exports = ProblemModel;