This commit is contained in:
sriramv 2022-06-08 12:20:51 +05:30
parent 674aa3dd60
commit bd8f138011
3 changed files with 8 additions and 45 deletions

View File

@ -12,8 +12,6 @@ exports.createNotes = async (req, res) =>
notes = JSON.stringify(value);
data = {
losid: req.body.losid,
module_name: req.body.module_name,
entity_reference: req.body.entity_reference,
notes: notes,
sheet_no : value.index + 1,
user_id: req.body.user_id,
@ -46,7 +44,7 @@ exports.updateNotes = async (req, res) =>
for (const value of req.body.notes)
{
sheet_no = value.index + 1;
notesData = await Workingnotes.findOne({where :{losid : req.body.losid , module_name : req.body.module_name, sheet_no : sheet_no , is_active:1}});
notesData = await Workingnotes.findOne({where :{losid : req.body.losid , sheet_no : sheet_no , is_active:1}});
if(notesData != undefined)
{
@ -62,8 +60,6 @@ exports.updateNotes = async (req, res) =>
notes = JSON.stringify(value);
data = {
losid: req.body.losid,
module_name: req.body.module_name,
entity_reference: req.body.entity_reference,
notes: notes,
sheet_no : value.index + 1,
user_id: req.body.user_id,
@ -95,18 +91,9 @@ exports.notesList = async (req, res) =>
{
try
{
if(req.query.entity_reference == undefined)
{
notesData = await Workingnotes.findAll({where :{losid : req.query.losid , module_name : req.query.module_name , is_active:1}})
.catch(err=>{console.log(err);});
res.send({'status':200 , message:"Success." ,'data': notesData});
}else{
notesData = await Workingnotes.findAll({where :{losid : req.query.losid , module_name : req.query.module_name , entity_reference : req.query.entity_reference, is_active:1}});
res.send({'status':200 , message:"Success." ,'data': notesData});
}
notesData = await Workingnotes.findAll({where :{losid : req.query.losid, is_active:1}}).catch(err=>{console.log(err);});
res.send({'status':200 , message:"Success." ,'data': notesData});
} catch(err) {
res.status(500).send({'status':404,

View File

@ -17,8 +17,6 @@ module.exports = (sequelize, DataTypes) => {
Workingnotes.init(
{
losid: { type: DataTypes.STRING },
module_name: { type: DataTypes.STRING },
entity_reference: { type: DataTypes.STRING },
notes: { type: DataTypes.STRING },
sheet_no: { type: DataTypes.STRING },
user_id: { type: DataTypes.INTEGER },

View File

@ -33,16 +33,6 @@ module.exports = app => {
* schema:
* type: string
* required: true
* - in: query
* name: module_name
* schema:
* type: string
* required: true
* - in: query
* name: entity_reference
* schema:
* type: string
* required: false
* example:
* responses:
* 200:
@ -59,14 +49,6 @@ module.exports = app => {
* type: string
* description: losid
* example: MW112233
* module_name:
* type: string
* description: gst (module_name)
* example: gst
* entity_reference:
* type: string
* description: (gst_no/cin_no)->entity_reference key
* example: cin756kjbjh76
* notes:
* type: array
* description:
@ -109,14 +91,6 @@ module.exports = app => {
* type: string
* description: losid
* example: MW112233
* module_name:
* type: string
* description: gst (module_name)
* example: gst
* entity_reference:
* type: string
* description: (gst_no/cin_no)->entity_reference key
* example: cin756kjbjh76
* notes:
* type: array
* description:
@ -129,6 +103,10 @@ module.exports = app => {
* type: integer
* description:
* example: 1
* createdby:
* type: integer
* description:
* example: 1
*/
/**
* @swagger