Implemented the challenge accept and decline buttons
TODO: Delete room when the challenged user declines the challenge
This commit is contained in:
@@ -41,6 +41,7 @@ app.use("/api/room", roomRoutes);
|
||||
app.use((error, req, res, next) => {
|
||||
const status = error.status || 500;
|
||||
const message = error.message || "Something went wrong.";
|
||||
console.log(error)
|
||||
res.status(status).json({ message: message });
|
||||
});
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ router.get(
|
||||
let { userData } = req;
|
||||
let challenges = await Challenge.find({ challenged: userData.username });
|
||||
if (!challenges) challenges = [];
|
||||
console.log("Challenges to", username, challenges);
|
||||
console.log("Challenges to", userData.username, challenges);
|
||||
res.json({ success: true, challenges: challenges });
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user