Tell us what’s happening:
Hello, I’m stuck here. When I press the button [I’ve completed this challenge]. Everything is fine except for the DELETE test which returns (Test time out)
###Your project link(s)
solution: https://ba1d3fa6-d31a-4aea-b217-7b1edcee739b-00-2t7qbfofp42d2.spock.replit.dev
githubLink: boilerplate-project-messageboard - Replit
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Challenge Information:
Information Security Projects - Anonymous Message Board
Here is the screenshoot
And here my delete code bloc:
.delete((req, res) => {
const { thread_id, reply_id, delete_password } = req.body;
const board = req.params.board;
BoardModel.findOne({ name: board }).then((data) => {
if (!data) {
console.log("No board with this name");
res.json({ error: "No board with this name" });
} else {
let thread = data.threads.id(thread_id);
if (!thread) {
return res.status(404).json({ error: 'Thread not found' });
}
let reply = thread.replies.id(reply_id);
if (!reply) {
return res.status(404).json({ error: 'Reply not found' });
}
console.log(reply)
if (reply.delete_password === delete_password) {
reply.text = "[deleted]";
res.send("success");
data.save().then((updatedData) => {
});
} else {
res.send("incorrect password");
return;
}
}
});
});