fix checking validity when solving

This commit is contained in:
sky
2025-07-27 03:47:32 -04:00
parent 3f08296e7c
commit 4742f78545

View File

@ -35,7 +35,7 @@ app.use("/solved", async (req, res) => {
res.send(readdirSync("./data").length);
});
app.post("/solve", async (req, res) => {
let file = "./data/" + req.body.uuid + "/image.png";
let file = Bun.file("./data/" + req.body.uuid + "/image.png");
if(await file.exists() && (req.body.answer.length == 4 || req.body.answer.length == 5)) {
await Bun.write("./data/" + req.body.uuid + "/answer.txt", req.body.answer);
}