Skip to content

Commit

Permalink
Added controllers/student.controller.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
DerickPascual committed Nov 9, 2024
1 parent ce7ea7f commit 6156030
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/controllers/student.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class StudentController {
const student = new Student(req.body);
const savedStudent = await student.save();

return savedStudent;
return savedStudent._doc;
} catch (err: any) {
throw err;
}
Expand All @@ -30,7 +30,7 @@ class StudentController {
})
}

return updatedStudent;
return updatedStudent._doc;
} catch (err: any) {
throw err;
}
Expand All @@ -56,7 +56,7 @@ class StudentController {
});
}

return deletedStudent;
return deletedStudent._doc;
} catch (err: any) {
throw err;
}
Expand All @@ -75,7 +75,7 @@ class StudentController {
})
}

return student;
return student._doc;
} catch (err: any) {
throw err;
}
Expand Down

0 comments on commit 6156030

Please sign in to comment.