Skip to content

Commit e3bb5b9

Browse files
authored
Merge pull request #6 from topcoder-platform/develop
Prod - fix for UUID group checking for new groups
2 parents f16f93f + 1bd30b0 commit e3bb5b9

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/api/group-membership/groupMembership.service.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,15 +524,12 @@ export class GroupMembershipService {
524524
* @returns response dto
525525
*/
526526
async getMemberGroups(memberId: string, dto: GetMemberGroupsDto) {
527-
const returnUuid = dto.uuid;
527+
const returnUuid = dto?.uuid ?? true;
528528
const memberships = await this.prisma.groupMembership.findMany({
529529
where: {
530530
memberId: memberId,
531531
group: {
532532
status: GroupStatus.ACTIVE,
533-
oldId: {
534-
not: null,
535-
},
536533
},
537534
},
538535
});
@@ -557,15 +554,15 @@ export class GroupMembershipService {
557554

558555
const groups: any[] = [];
559556
groupRes.forEach((groupL1) => {
560-
if (groupL1.status === GroupStatus.ACTIVE && groupL1.oldId) {
557+
if (groupL1.status === GroupStatus.ACTIVE) {
561558
groups.push(groupL1);
562559
}
563560
groupL1.parentGroups.forEach((groupL2) => {
564-
if (groupL2.status === GroupStatus.ACTIVE && groupL2.oldId) {
561+
if (groupL2.status === GroupStatus.ACTIVE) {
565562
groups.push(groupL2);
566563
}
567564
groupL2.parentGroups.forEach((groupL3) => {
568-
if (groupL3.status === GroupStatus.ACTIVE && groupL3.oldId) {
565+
if (groupL3.status === GroupStatus.ACTIVE) {
569566
groups.push(groupL3);
570567
}
571568
});

src/dto/groupMembership.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ export class GetMemberGroupsDto {
107107
name: 'uuid',
108108
description: 'whether return uuid',
109109
type: 'boolean',
110-
default: false,
110+
default: true,
111111
required: false,
112112
})
113113
@Transform(({ value }) => transformBoolean(value))
114114
@IsBoolean()
115115
@IsOptional()
116-
uuid: boolean = false;
116+
uuid: boolean = true;
117117
}
118118

119119
export class GetGroupMembersCountDto {

0 commit comments

Comments
 (0)