Skip to content

Commit 86243cc

Browse files
authored
Merge pull request #138 from YuStudy-Inc/finalfixes
finished friend req, editing delete quiz
2 parents 78aa7b9 + 040e242 commit 86243cc

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Backend/controllers/quizController.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,14 @@ export const deleteQuiz = async(req, res) => {
5656
const quizId = req.body.quizId
5757
console.log(quizId)
5858

59+
await Question.deleteMany({ quizId: quizId })
60+
5961
const deletedQuiz = await Quiz.findByIdAndDelete(quizId);
6062
if (!deletedQuiz) {
6163
res.status(500).json({error: "Quiz was not found"})
6264
return;
6365
}
66+
6467
res.status(200).json({message: 'Quiz deleted successfullly' })
6568
}
6669
catch(err){

Frontend/src/Components/Home/FriendRequest.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const FriendRequest = ({ index, friendId, incomingFriendPfp, incomingFriendName,
2525
}
2626

2727
const reject = async () => {
28+
console.log(friendId)
2829
try {
2930
const response = await axios.put(`${URI}users/rejectFriendRequest/${userId}`, {
3031
friendId: friendId

0 commit comments

Comments
 (0)