deleteApi:GWM
This commit is contained in:
parent
eccf7d2dc1
commit
7454ef24f2
@ -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
|
||||||
|
|
||||||
|
};
|
||||||
@ -150,7 +150,24 @@ module.exports = app => {
|
|||||||
router.post("/updateNotes", Notescontroller.updateNotes);
|
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
|
// routes started here
|
||||||
app.use('/api', router);
|
app.use('/api', router);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user