deleteApi:GWM

This commit is contained in:
sriramv 2022-06-02 10:47:36 +05:30
parent eccf7d2dc1
commit 7454ef24f2
2 changed files with 34 additions and 1 deletions

View File

@ -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
};

View File

@ -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);