socket Manager duplication of zone controller
This commit is contained in:
@@ -11,16 +11,8 @@ import {
|
||||
|
||||
const v1Zone = express.Router();
|
||||
|
||||
v1Zone.post(
|
||||
"/zones",
|
||||
tokenValidator,
|
||||
CreateZoneController
|
||||
);
|
||||
v1Zone.patch(
|
||||
"/zones/delete",
|
||||
tokenValidator,
|
||||
DeleteZoneController
|
||||
);
|
||||
v1Zone.post("/zones", tokenValidator, CreateZoneController);
|
||||
v1Zone.patch("/zones/delete", tokenValidator, DeleteZoneController);
|
||||
|
||||
v1Zone.get(
|
||||
"/zones/visualization/:projectId",
|
||||
@@ -28,19 +20,11 @@ v1Zone.get(
|
||||
VizZoneController
|
||||
);
|
||||
|
||||
v1Zone.get(
|
||||
"/zones/:projectId/:zoneId",
|
||||
tokenValidator,
|
||||
ZoneDataController
|
||||
);
|
||||
v1Zone.get("/zones/:projectId/:zoneId", tokenValidator, ZoneDataController);
|
||||
v1Zone.get(
|
||||
"/zones/panel/:projectId/:zoneId",
|
||||
tokenValidator,
|
||||
SingleZonePanelController
|
||||
);
|
||||
v1Zone.get(
|
||||
"/zones/:projectId",
|
||||
tokenValidator,
|
||||
GetZoneController
|
||||
);
|
||||
v1Zone.get("/zones/:projectId", tokenValidator, GetZoneController);
|
||||
export default v1Zone;
|
||||
|
||||
@@ -278,7 +278,7 @@ export class ZoneService {
|
||||
const { organization } = req.params;
|
||||
|
||||
const findZoneId = await zoneSchema(organization)
|
||||
.find()
|
||||
.find({ isArchive: false })
|
||||
.select(
|
||||
"zoneId zoneName layer points viewPortCenter viewPortposition -_id"
|
||||
);
|
||||
@@ -286,7 +286,7 @@ export class ZoneService {
|
||||
if (!findZoneId) {
|
||||
res.status(500).json({ message: "Invalid zone" });
|
||||
}
|
||||
res.status(201).json({ data: findZoneId, organization: organization });
|
||||
res.status(200).json({ data: findZoneId, organization: organization });
|
||||
} catch (error) {
|
||||
console.log("error: ", error);
|
||||
res.status(500).json({ message: "Zone not found", error });
|
||||
|
||||
Reference in New Issue
Block a user