Update Redis configuration and enhance collection update logic with error handling
This commit is contained in:
4
.env
4
.env
@@ -8,8 +8,8 @@ SOCKET_PORT=8002
|
|||||||
JWT_SECRET="Schema_Studio"
|
JWT_SECRET="Schema_Studio"
|
||||||
REFRESH_JWT_SECRET="Schema_Studio"
|
REFRESH_JWT_SECRET="Schema_Studio"
|
||||||
|
|
||||||
REDIS_ENV= true
|
REDIS_ENV= false
|
||||||
REDIS_LOCAL =127.0.0.1
|
REDIS_LOCAL = 192.168.0.203
|
||||||
REDIS_PORT=6379
|
REDIS_PORT=6379
|
||||||
|
|
||||||
EMAIL_USER=nivetha@hexrfactory.com
|
EMAIL_USER=nivetha@hexrfactory.com
|
||||||
|
|||||||
@@ -91,9 +91,9 @@ export const updateCollectionController = async (
|
|||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
const { organization, userId } = req.user || {};
|
const { organization, userId } = req.user || {};
|
||||||
|
const { collectionNodeId } = req.params
|
||||||
const {
|
const {
|
||||||
projectId,
|
projectId,
|
||||||
collectionNodeId,
|
|
||||||
collectionName,
|
collectionName,
|
||||||
position,
|
position,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ collectionNodeRoutes.post(
|
|||||||
authorizedRoles("Admin", "Editor", "Viewer"),
|
authorizedRoles("Admin", "Editor", "Viewer"),
|
||||||
NodeCreationController
|
NodeCreationController
|
||||||
);
|
);
|
||||||
//collection Added
|
//collection update
|
||||||
collectionNodeRoutes.patch(
|
collectionNodeRoutes.patch(
|
||||||
"/nodes/collectionName",
|
"/nodes/:collectionNodeId",
|
||||||
tokenValidator,
|
tokenValidator,
|
||||||
authorizedRoles("Admin", "Editor", "Viewer"),
|
authorizedRoles("Admin", "Editor", "Viewer"),
|
||||||
updateCollectionController
|
updateCollectionController
|
||||||
|
|||||||
@@ -231,8 +231,14 @@ export const updatecollection = async (
|
|||||||
},
|
},
|
||||||
{ new: true }
|
{ new: true }
|
||||||
);
|
);
|
||||||
|
if(collectionNameupdate){
|
||||||
|
|
||||||
return { status: "Success" };
|
return { status: "Success" };
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
return {status:"Update unsuccessfull"}
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user