Surya: swagger update
This commit is contained in:
parent
5342f016d3
commit
44c8db0be9
@ -340,7 +340,7 @@ exports.ItemFilter = (req, res) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
exports.createRemarkss = (req, res) => {
|
exports.createRemarks = (req, res) => {
|
||||||
|
|
||||||
const req_array_data = req.body;
|
const req_array_data = req.body;
|
||||||
try
|
try
|
||||||
@ -373,51 +373,7 @@ exports.createRemarkss = (req, res) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.createRemarks = (req, res) => {
|
|
||||||
const obj = req.body
|
|
||||||
if (obj.hasOwnProperty("id"))
|
|
||||||
{
|
|
||||||
// update broken periods
|
|
||||||
const Id = req.body.id
|
|
||||||
Fin_remarks.update( {
|
|
||||||
entity_id: req.body.entity_id,
|
|
||||||
itemid: req.body.itemid,
|
|
||||||
remarks: req.body.remarks,
|
|
||||||
is_active: req.body.is_active,
|
|
||||||
createdby: req.body.createdby,
|
|
||||||
updatedby: req.body.updatedby,
|
|
||||||
} , { where: { id: Id } })
|
|
||||||
.then(data => {
|
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
res.status(404).send({'status':404,
|
|
||||||
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// create broken period
|
|
||||||
Fin_remarks.create( {
|
|
||||||
entity_id: req.body.entity_id,
|
|
||||||
itemid: req.body.itemid,
|
|
||||||
remarks: req.body.remarks,
|
|
||||||
is_active: req.body.is_active,
|
|
||||||
createdby: req.body.createdby,
|
|
||||||
})
|
|
||||||
.then(data => {
|
|
||||||
res.send({'status':200,'message':"success",'data':data});
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
res.status(404).send({'status':404,
|
|
||||||
message: err.message || "Some error occurred while insertinging statements." ,'data': "No data"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -644,11 +644,58 @@ module.exports = app => {
|
|||||||
* description: success
|
* description: success
|
||||||
*/
|
*/
|
||||||
// get financials summary
|
// get financials summary
|
||||||
router.get("/ItemFilter/:section", master.ItemFilter);
|
router.get("/ItemFilter", master.ItemFilter);
|
||||||
|
|
||||||
router.post("/createRemarkss", master.createRemarkss);
|
/**
|
||||||
|
* @swagger
|
||||||
|
* definitions:
|
||||||
|
* remarks:
|
||||||
|
* type: object
|
||||||
|
* properties:
|
||||||
|
* entity_id:
|
||||||
|
* type: integer
|
||||||
|
* description: id of the entity
|
||||||
|
* example: 1
|
||||||
|
* itemid:
|
||||||
|
* type: integer
|
||||||
|
* description: id of the item
|
||||||
|
* example: 1
|
||||||
|
* remarks:
|
||||||
|
* type: string
|
||||||
|
* description: remarks
|
||||||
|
* example: testttttttttttttt
|
||||||
|
* is_active:
|
||||||
|
* type: integer
|
||||||
|
* description: the state of section(0 means inactive,1 means active)
|
||||||
|
* example: 1
|
||||||
|
* createdby:
|
||||||
|
* type: integer
|
||||||
|
* description: The person who created
|
||||||
|
* example: 1
|
||||||
|
* updatedby:
|
||||||
|
* type: integer
|
||||||
|
* description: The person who modified
|
||||||
|
* example: 1
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @swagger
|
||||||
|
* /api/createRemarks:
|
||||||
|
* post:
|
||||||
|
* summary: create Remarks
|
||||||
|
* description: create Remarks
|
||||||
|
* requestBody:
|
||||||
|
* content:
|
||||||
|
* application/json:
|
||||||
|
* schema:
|
||||||
|
* $ref: '#/definitions/remarks'
|
||||||
|
* responses:
|
||||||
|
* 200:
|
||||||
|
* description: item created succesfully
|
||||||
|
* 500:
|
||||||
|
* description: failure in creating item
|
||||||
|
*/
|
||||||
router.post("/createRemarks", master.createRemarks);
|
router.post("/createRemarks", master.createRemarks);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user