feat: resolving bugs in checklist testing

This commit is contained in:
=
2025-10-10 00:09:46 +05:30
parent c2490380f0
commit 44b50c93c3
19 changed files with 140 additions and 111 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ export const groupDALFactory = (db: TDbClient) => {
.where(`${TableName.Membership}.scope`, AccessScope.Organization)
.join(TableName.Membership, `${TableName.Groups}.id`, `${TableName.Membership}.actorGroupId`)
.join(TableName.MembershipRole, `${TableName.MembershipRole}.membershipId`, `${TableName.Membership}.id`)
.join(TableName.Role, `${TableName.MembershipRole}.customRoleId`, `${TableName.Role}.id`)
.leftJoin(TableName.Role, `${TableName.MembershipRole}.customRoleId`, `${TableName.Role}.id`)
.select(selectAllTableCols(TableName.Groups))
// cr stands for custom role
.select(db.ref("id").as("crId").withSchema(TableName.Role))
@@ -210,7 +210,7 @@ export const groupDALFactory = (db: TDbClient) => {
.where(`${TableName.Membership}.scope`, AccessScope.Organization)
.where((queryBuilder) => {
Object.entries(filter).forEach(([key, value]) => {
void queryBuilder.where(`${TableName.Membership}.${key}`, value);
void queryBuilder.where(`${TableName.Groups}.${key}`, value);
});
})
.select(
+14 -10
View File
@@ -223,16 +223,20 @@ export const groupServiceFactory = ({
}
}
const [updated] = await groupDAL.update(
{
id: group.id
},
{
name,
slug: slug ? slugify(slug) : undefined
},
tx
);
let updated = group;
if (name || slug) {
[updated] = await groupDAL.update(
{
id: group.id
},
{
name,
slug: slug ? slugify(slug) : undefined
},
tx
);
}
if (role) {
const membership = await membershipGroupDAL.findOne(