diff --git a/app/controllers/working.notes.controller.js b/app/controllers/working.notes.controller.js index 4f3d10b..14aefd0 100644 --- a/app/controllers/working.notes.controller.js +++ b/app/controllers/working.notes.controller.js @@ -119,3 +119,19 @@ exports.notesList = async (req, res) => +exports.deleteNotes = async (req, res) => +{ + try + { + // update working notes data (is_active = 0) + await Workingnotes.update({is_active: 0} , { where: { id: req.query.id } }) + .then(data=>{ logMsg.info("Notes update Success");}) + .catch(err=>{ logMsg.info("Notes update Failed");}); + res.send({'status':200 , message:"Success." ,'data': "no data"}); + + } catch(err) { + res.status(500).send({'status':404, + message: err.message || "Some error occurred while inserting statements." ,'data': "No data" + }); } //end of try catch + +}; \ No newline at end of file diff --git a/app/routes/routes.js b/app/routes/routes.js index a303a04..303b8fe 100644 --- a/app/routes/routes.js +++ b/app/routes/routes.js @@ -150,7 +150,24 @@ module.exports = app => { router.post("/updateNotes", Notescontroller.updateNotes); - +/** +* @swagger +* /api/deleteNotes: +* get: +* summary: deactivate notes data +* description: +* parameters: +* - in: query +* name: id +* schema: +* type: integer +* required: true +* example: +* responses: +* 200: +* description: success +*/ +router.get("/deleteNotes", Notescontroller.deleteNotes); // routes started here app.use('/api', router);