feat: go greppy

This commit is contained in:
=
2025-10-10 00:09:48 +05:30
parent fe1bc168f6
commit 97135d9cfa
46 changed files with 150 additions and 106 deletions
@@ -51,8 +51,7 @@ export const membershipUserDALFactory = (db: TDbClient) => {
} else if (scopeData.scope === AccessScope.Namespace) {
void qb
.where(`${TableName.Membership}.scope`, AccessScope.Namespace)
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId)
.whereNull(`${TableName.Membership}.scopeNamespaceId`);
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId);
} else if (scopeData.scope === AccessScope.Project) {
void qb
.where(`${TableName.Membership}.scope`, AccessScope.Project)
@@ -168,8 +167,7 @@ export const membershipUserDALFactory = (db: TDbClient) => {
} else if (scopeData.scope === AccessScope.Namespace) {
void qb
.where(`${TableName.Membership}.scope`, AccessScope.Namespace)
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId)
.whereNull(`${TableName.Membership}.scopeNamespaceId`);
.where(`${TableName.Membership}.scopeNamespaceId`, scopeData.namespaceId);
} else if (scopeData.scope === AccessScope.Project) {
void qb
.where(`${TableName.Membership}.scope`, AccessScope.Project)
@@ -192,7 +190,7 @@ export const membershipUserDALFactory = (db: TDbClient) => {
case "role":
return [`${TableName.Role}.slug`, `${TableName.MembershipRole}.role`];
case "username":
return `${TableName.Users}.name`;
return `${TableName.Users}.username`;
default:
throw new BadRequestError({ message: `Invalid ${String(attr)} provided` });
}