Update Redis configuration and enhance collection update logic with error handling

This commit is contained in:
2025-10-22 13:41:35 +05:30
parent b58433d77f
commit dbd0132936
4 changed files with 12 additions and 6 deletions

4
.env
View File

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

View File

@@ -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,

View File

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

View File

@@ -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 {