diff --git a/.DS_Store b/.DS_Store index 6a48c4a..80cf790 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/.DS_Store b/app/.DS_Store index cbbe313..a0123b6 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/controllers/vehicle-repair.controller.js b/app/controllers/vehicle-repair.controller.js index 13104cd..90a8655 100644 --- a/app/controllers/vehicle-repair.controller.js +++ b/app/controllers/vehicle-repair.controller.js @@ -48,6 +48,23 @@ exports.getAllVehicleRepairs = (req, res) => { }); } +exports.updateVehicleRepair = (req, res) => { + const id = req.params.id; + VehicleRepair.findByIdAndUpdate(id, req.body, { new: true }) + .then(data => { + if (!data) { + res.status(404).send({ message: `Cannot update Vehicle Repair Record with id=${id}.` }); + } else { + res.send(data); + } + }) + .catch(err => { + res.status(500).send({ + message: err.message || "Could not update Vehicle Repair Record." + }); + }); +} + exports.deleteVehicleRepair = (req, res) => { const id = req.params.id; VehicleRepair.findByIdAndDelete(id) diff --git a/app/routes/vehicle-repair.route.js b/app/routes/vehicle-repair.route.js index bde3ddb..84793f6 100644 --- a/app/routes/vehicle-repair.route.js +++ b/app/routes/vehicle-repair.route.js @@ -11,6 +11,7 @@ module.exports = app => { var router = require("express").Router(); router.get("/", [authJwt.verifyToken], vehicleRepairs.getAllVehicleRepairs); router.post("/", [authJwt.verifyToken], vehicleRepairs.createVehicleRepair); + router.put("/:id", [authJwt.verifyToken], vehicleRepairs.updateVehicleRepair); router.delete("/:id", [authJwt.verifyToken], vehicleRepairs.deleteVehicleRepair); app.use('/api/vehicle-repairs', router); }; \ No newline at end of file diff --git a/app/views/asset-manifest.json b/app/views/asset-manifest.json index e750ec6..e37516f 100644 --- a/app/views/asset-manifest.json +++ b/app/views/asset-manifest.json @@ -1,16 +1,16 @@ { "files": { "main.css": "/static/css/main.46cc12be.css", - "main.js": "/static/js/main.671a9950.js", + "main.js": "/static/js/main.c98c5007.js", "static/js/787.c4e7f8f9.chunk.js": "/static/js/787.c4e7f8f9.chunk.js", "static/media/landing.png": "/static/media/landing.d4c6072db7a67dff6a78.png", "index.html": "/index.html", "main.46cc12be.css.map": "/static/css/main.46cc12be.css.map", - "main.671a9950.js.map": "/static/js/main.671a9950.js.map", + "main.c98c5007.js.map": "/static/js/main.c98c5007.js.map", "787.c4e7f8f9.chunk.js.map": "/static/js/787.c4e7f8f9.chunk.js.map" }, "entrypoints": [ "static/css/main.46cc12be.css", - "static/js/main.671a9950.js" + "static/js/main.c98c5007.js" ] } \ No newline at end of file diff --git a/app/views/index.html b/app/views/index.html index bdbca09..affcb20 100644 --- a/app/views/index.html +++ b/app/views/index.html @@ -1 +1 @@ -
| ".concat(e.label," | ")})).join(""),"\n
|---|
| ".concat(t[e.key]||""," | ")})).join(""),"\n