bug fix on delete

This commit is contained in:
JBB0807 2025-05-08 00:14:10 -07:00
parent a494cd4f0a
commit 06a6e9b8a5
3 changed files with 14 additions and 7 deletions

View file

@ -236,11 +236,13 @@ app.put("/assignments/:id", async (req, res) => {
app.delete("/assignments/:id", async (req, res) => {
try {
const { id } = req.params;
console.log("Deleting assignment with ID:", id);
await prisma.assignments.delete({
where: { assignmentid: parseInt(id) },
});
console.log("Assignment deleted successfully:", id);
res.json({ message: "Assignment deleted successfully" });
} catch (err) {
console.error("Error deleting assignment:", err.message);