feat: updated nitpicks

This commit is contained in:
=
2025-03-25 01:53:52 +05:30
parent 26a9d68823
commit c8553fba2b
3 changed files with 6 additions and 6 deletions
@@ -208,7 +208,7 @@ export const identityProjectAdditionalPrivilegeServiceFactory = ({
} }
const isTemporary = typeof data?.isTemporary !== "undefined" ? data.isTemporary : identityPrivilege.isTemporary; const isTemporary = typeof data?.isTemporary !== "undefined" ? data.isTemporary : identityPrivilege.isTemporary;
validateHandlebarTemplate("Identity Additional Privilege Create", JSON.stringify(data.permissions || []), { validateHandlebarTemplate("Identity Additional Privilege Update", JSON.stringify(data.permissions || []), {
allowedExpressions: (val) => val.includes("identity.") allowedExpressions: (val) => val.includes("identity.")
}); });
@@ -93,7 +93,7 @@ export const projectUserAdditionalPrivilegeServiceFactory = ({
if (existingSlug) if (existingSlug)
throw new BadRequestError({ message: `Additional privilege with provided slug ${slug} already exists` }); throw new BadRequestError({ message: `Additional privilege with provided slug ${slug} already exists` });
validateHandlebarTemplate("User Additional Privilege Update", JSON.stringify(customPermission || []), { validateHandlebarTemplate("User Additional Privilege Create", JSON.stringify(customPermission || []), {
allowedExpressions: (val) => val.includes("identity.") allowedExpressions: (val) => val.includes("identity.")
}); });
@@ -73,13 +73,13 @@ export const projectRoleServiceFactory = ({
throw new BadRequestError({ name: "Create Role", message: "Project role with same slug already exists" }); throw new BadRequestError({ name: "Create Role", message: "Project role with same slug already exists" });
} }
validateHandlebarTemplate("Project Role Create", JSON.stringify(data.permissions || []), {
allowedExpressions: (val) => val.includes("identity.")
});
const role = await projectRoleDAL.create({ const role = await projectRoleDAL.create({
...data, ...data,
projectId projectId
}); });
validateHandlebarTemplate("Project Role Create", JSON.stringify(data.permissions || []), {
allowedExpressions: (val) => val.includes("identity.")
});
return { ...role, permissions: unpackPermissions(role.permissions) }; return { ...role, permissions: unpackPermissions(role.permissions) };
}; };
@@ -138,7 +138,7 @@ export const projectRoleServiceFactory = ({
if (existingRole && existingRole.id !== roleId) if (existingRole && existingRole.id !== roleId)
throw new BadRequestError({ name: "Update Role", message: "Project role with the same slug already exists" }); throw new BadRequestError({ name: "Update Role", message: "Project role with the same slug already exists" });
} }
validateHandlebarTemplate("Project Role Upadte", JSON.stringify(data.permissions || []), { validateHandlebarTemplate("Project Role Update", JSON.stringify(data.permissions || []), {
allowedExpressions: (val) => val.includes("identity.") allowedExpressions: (val) => val.includes("identity.")
}); });
const updatedRole = await projectRoleDAL.updateById(projectRole.id, { const updatedRole = await projectRoleDAL.updateById(projectRole.id, {