bugs cleared for the testing purpose

This commit is contained in:
2025-06-02 16:48:44 +05:30
parent 17727c1281
commit 09ea99098f
41 changed files with 117 additions and 163 deletions

View File

@@ -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;
}