fix checking validity when solving
This commit is contained in:
2
index.js
2
index.js
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user