Visualization Part 2d and floating API Completed. Template Save and Get API completed
This commit is contained in:
@@ -4,10 +4,10 @@ import panelSchema from "../../../shared/model/vizualization/panelmodel.ts";
|
||||
import widgetSchema from "../../../shared/model/vizualization/widgemodel.ts";
|
||||
export class Zoneservice {
|
||||
static async addandUpdateZone(req: Request, res: Response): Promise<any> {
|
||||
const organization = req.body.organization;
|
||||
const zoneDatas = req.body.zonesdata;
|
||||
|
||||
console.log("req.body: ", req.body);
|
||||
try {
|
||||
const organization = req.body.organization;
|
||||
const zoneDatas = req.body.zonesdata;
|
||||
const existingZone = await zoneSchema(organization).findOne({
|
||||
zoneId: zoneDatas.zoneId,
|
||||
isArchive: false,
|
||||
@@ -43,6 +43,7 @@ export class Zoneservice {
|
||||
},
|
||||
{ new: true }
|
||||
);
|
||||
console.log("replaceZone: ", replaceZone);
|
||||
if (!replaceZone)
|
||||
return res.status(404).json({ message: "Zone not updated" });
|
||||
else
|
||||
@@ -231,7 +232,8 @@ export class Zoneservice {
|
||||
|
||||
static async ZoneData(req: Request, res: Response): Promise<any> {
|
||||
try {
|
||||
const organization = req.query.organization;
|
||||
console.log("req.params: ", req.params);
|
||||
const organization = req.params.organization;
|
||||
const zoneId = req.params.zoneId;
|
||||
const findZone = await zoneSchema(organization).findOne({
|
||||
zoneId: zoneId,
|
||||
|
||||
Reference in New Issue
Block a user