From 97beb526e1236bc3ed5e419c64ceb8bffa8aa33d Mon Sep 17 00:00:00 2001 From: hewenyang Date: Sat, 14 Apr 2018 14:45:26 +0000 Subject: [PATCH] Oh I may have broken sqlite... --- modules/problem.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/problem.js b/modules/problem.js index 96b2b30..f30da2d 100644 --- a/modules/problem.js +++ b/modules/problem.js @@ -583,7 +583,10 @@ async function setPublic(req, res, is_public) { problem.publicizer_id = res.locals.user.id; await problem.save(); - await syzoj.db.query("UPDATE `judge_state` JOIN `problem` ON `problem`.`id` = `judge_state`.`problem_id` SET `judge_state`.`is_public` = `problem`.`is_public` WHERE `problem`.`id` = " + id); + JudgeState.model.update( + { is_public: is_public }, + { where: { problem_id: id } } + ); res.redirect(syzoj.utils.makeUrl(['problem', id])); } catch (e) {