bugs cleared for the testing purpose
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user