query:param:GWM
This commit is contained in:
parent
1210f84343
commit
c35d3adfad
@ -37,7 +37,7 @@ exports.MenuList = async (req, res) => {
|
||||
//findAll({ where :{is_active : 1} ,include : { association: 'sectionsmasterData' } });
|
||||
//findAll({ where :{is_active : 1} , include: { all: true, nested: true , where :{is_active : 1} }});
|
||||
try {
|
||||
const losid = req.params.losid
|
||||
const losid = req.query.losid
|
||||
const MasterData = await Statementsmaster.findAll({
|
||||
where :{is_active : 1} ,
|
||||
attributes: ['id', 'statement', 'is_active'],
|
||||
@ -81,7 +81,7 @@ exports.MenuList = async (req, res) => {
|
||||
|
||||
// FinantialsSummary
|
||||
exports.FinantialsSummary = async (req, res) => {
|
||||
const id = req.params.id
|
||||
const id = req.query.entityid
|
||||
|
||||
Financials.findAll({where : { entity_id : id } ,attributes: ['fy'], group: ['fy'] , order: [['fy', 'DESC']] })
|
||||
.then(data => {
|
||||
@ -113,11 +113,11 @@ exports.FinantialsSummary = async (req, res) => {
|
||||
|
||||
// Broken period list api
|
||||
exports.BrokenPeriodsList = (req, res) => {
|
||||
const entityid = req.params.entityid
|
||||
const entityid = req.query.entityid
|
||||
try {
|
||||
Brokenperiods.findOne({where : { entity_id : entityid } })
|
||||
.then(data => {
|
||||
console.log(data);
|
||||
|
||||
if(data)
|
||||
{res.send({'status':200,'message':"success",'data':data});}
|
||||
else{res.send({'status':404,'message':"failed",'data':"nodata"});}
|
||||
|
||||
@ -22,7 +22,7 @@ module.exports = (sequelize, DataTypes) => {
|
||||
months: { type: DataTypes.INTEGER },
|
||||
cy: { type: DataTypes.INTEGER },
|
||||
py: { type: DataTypes.INTEGER },
|
||||
variation: { type: DataTypes.INTEGER },
|
||||
variation: { type: DataTypes.STRING },
|
||||
createdby: { type: DataTypes.INTEGER },
|
||||
updatedby: { type: DataTypes.INTEGER },
|
||||
|
||||
|
||||
@ -20,13 +20,13 @@ module.exports = app => {
|
||||
router.post("/BrokenPeriods", financials.BrokenPeriods);
|
||||
|
||||
// get financials summary
|
||||
router.get("/FinantialsSummary/:id", financials.FinantialsSummary);
|
||||
router.get("/FinantialsSummary", financials.FinantialsSummary);
|
||||
|
||||
// get menu list
|
||||
router.get("/MenuList/:losid", financials.MenuList);
|
||||
router.get("/MenuList", financials.MenuList);
|
||||
|
||||
// Retrieve all Broken periods
|
||||
router.get("/BrokenPeriodsList/:entityid", financials.BrokenPeriodsList);
|
||||
router.get("/BrokenPeriodsList", financials.BrokenPeriodsList);
|
||||
|
||||
// fetching all master data
|
||||
router.get("/MasterDatas", financials.MasterDatas);
|
||||
@ -36,7 +36,7 @@ module.exports = app => {
|
||||
|
||||
// update financials data
|
||||
router.post("/updateFinancials", financials.updateFinancials);
|
||||
//router.get("/test", financials.test);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user