bugs cleared for the testing purpose
This commit is contained in:
@@ -3,7 +3,7 @@ ARG NODE_VERSION=lts
|
||||
FROM node:${NODE_VERSION}-alpine AS development
|
||||
# Use production node environment by default.
|
||||
|
||||
ENV NODE_ENV = development
|
||||
ENV NODE_ENV=development
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export const SignupController = async (
|
||||
): Promise<void> => {
|
||||
try {
|
||||
console.log("req.body: ", req.body);
|
||||
const { userName, Email, Password, profilePicture } = req.body;
|
||||
const { userName, Email, Password } = req.body;
|
||||
if (!userName || !Email || !Password) {
|
||||
res.status(400).json({
|
||||
message: "All fields are required",
|
||||
|
||||
@@ -13,15 +13,14 @@ export const SetNewCamera = async (
|
||||
): Promise<void> => {
|
||||
try {
|
||||
const { organization, userId } = req.user || {};
|
||||
const { position, target, rotation, projectId, versionId } = req.body;
|
||||
const { position, target, rotation, projectId} = req.body;
|
||||
if (
|
||||
!organization ||
|
||||
!userId ||
|
||||
!position ||
|
||||
!target ||
|
||||
!rotation ||
|
||||
!projectId ||
|
||||
!versionId
|
||||
!projectId
|
||||
) {
|
||||
res.status(400).json({
|
||||
message: "All fields are required",
|
||||
@@ -33,7 +32,6 @@ export const SetNewCamera = async (
|
||||
target,
|
||||
rotation,
|
||||
projectId,
|
||||
versionId,
|
||||
organization,
|
||||
userId,
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ export const createProjectController = async (
|
||||
const { userId, organization } = req.user || {};
|
||||
const { projectUuid, thumbnail } = req.body;
|
||||
|
||||
if (!req.user || !req.user.userId || !req.user.organization) {
|
||||
if (!req.user?.userId || !req.user?.organization) {
|
||||
res.status(401).json({ message: "Unauthorized" });
|
||||
return;
|
||||
}
|
||||
@@ -106,7 +106,7 @@ export const RemoveProject = async (
|
||||
try {
|
||||
const { projectId } = req.params;
|
||||
const { organization, userId } = req.user || {};
|
||||
if (!req.user || !req.user.userId || !req.user.organization) {
|
||||
if (!req.user?.userId || !req.user?.organization) {
|
||||
res.status(401).json({ message: "Unauthorized" });
|
||||
return;
|
||||
}
|
||||
@@ -208,12 +208,7 @@ export const ViewData = async (
|
||||
): Promise<void> => {
|
||||
try {
|
||||
const { organization, userId, role } = req.user || {};
|
||||
if (
|
||||
!req.user ||
|
||||
!req.user.userId ||
|
||||
!req.user.organization ||
|
||||
!req.user.role
|
||||
) {
|
||||
if (!req.user?.userId || !req.user?.organization) {
|
||||
res.status(401).json({ message: "Unauthorized" });
|
||||
return;
|
||||
}
|
||||
@@ -269,7 +264,7 @@ export const ProjectDuplicateController = async (
|
||||
const { userId, organization } = req.user || {};
|
||||
const { projectUuid, thumbnail, projectName } = req.body;
|
||||
|
||||
if (!req.user || !req.user.userId || !req.user.organization) {
|
||||
if (!req.user?.userId || !req.user?.organization) {
|
||||
res.status(401).json({ message: "Unauthorized" });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ export const AddWidgetController = async (
|
||||
res.status(404).json({
|
||||
message: "Zone not found",
|
||||
});
|
||||
break;
|
||||
case "panelName not found":
|
||||
res.status(404).json({
|
||||
message: "panelName not found",
|
||||
@@ -179,11 +180,6 @@ export const WidgetUpdateController = async (
|
||||
message: "Project not found",
|
||||
});
|
||||
break;
|
||||
case "Project not found":
|
||||
res.status(404).json({
|
||||
message: "Project not found",
|
||||
});
|
||||
break;
|
||||
case "Zone not found for the zoneId":
|
||||
res.status(404).json({
|
||||
message: "Zone not found for the zoneId",
|
||||
@@ -247,11 +243,6 @@ export const GetWidgetController = async (
|
||||
message: "Project not found",
|
||||
});
|
||||
break;
|
||||
case "Project not found":
|
||||
res.status(404).json({
|
||||
message: "Project not found",
|
||||
});
|
||||
break;
|
||||
case "Zone not found for the zoneId":
|
||||
res.status(404).json({
|
||||
message: "Zone not found for the zoneId",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import express from "express";
|
||||
import { tokenValidator } from "../../../shared/utils/token.ts";
|
||||
import authorizedRoles from "../../../shared/middleware/rbacMiddleware.ts";
|
||||
import {
|
||||
recentDataController,
|
||||
searchProjectController,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import express from "express";
|
||||
import { tokenValidator } from "../../../shared/utils/token.ts";
|
||||
import authorizedRoles from "../../../shared/middleware/rbacMiddleware.ts";
|
||||
import {
|
||||
DeleteTrashData,
|
||||
GetTrashList,
|
||||
|
||||
@@ -35,7 +35,7 @@ import v1PanelRoutes from "./V1/v1Routes/vizRoutes.ts/v1-panelRoutes.ts";
|
||||
import v1Template from "./V1/v1Routes/vizRoutes.ts/v1-TemplateRoutes.ts";
|
||||
import v1Widget from "./V1/v1Routes/vizRoutes.ts/v1-widgetRoutes.ts";
|
||||
import v1Widget3d from "./V1/v1Routes/vizRoutes.ts/v1-widget3dRoutes.ts";
|
||||
redis;
|
||||
redis
|
||||
const app = express();
|
||||
app.use(cors());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user