diff --git a/routes/reports.js b/routes/reports.js index 7840b71666cabdcaf1cdb422512d2edaeb84cdc3..4d04f2e81b06923b899f4b5069ef1e9c5708b510 100644 --- a/routes/reports.js +++ b/routes/reports.js @@ -120,10 +120,10 @@ router.get("/:id", authMiddleware, (req, res) => { // 🔹 Update Report (แก้ไขเฉพาะ Title, Description) router.put("/:id", authMiddleware, (req, res) => { - const { title, description } = req.body; + const { title, description, room_id } = req.body; db.query( - "UPDATE reports SET title=?, description=? WHERE id=?", - [title, description, req.params.id], + "UPDATE reports SET title=?, description=?, room_id=? WHERE id=?", + [title, description, room_id, req.params.id], (err, result) => { if (err) return res.status(500).json({ error: err.message }); res.json({ message: "Report Updated!" });