Skip to content

Commit b4d127c

Browse files
committed
role fix
1 parent 0dd977e commit b4d127c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

server/src/services/business/AuthService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ class AuthService implements IAuthService {
436436
throw new ApiError("Organization entitlement error");
437437
}
438438

439-
const orgRoles = await this.roleRepository.findById(
439+
const orgRoles = await this.roleRepository.findByIdAndOrgId(
440440
orgMembership.roleId || "",
441441
org.id
442442
);

server/src/services/business/InviteService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ class InviteService implements IInviteService {
5555
teamRoleId: string
5656
) => {
5757
try {
58-
const role = await this.roleRepository.findById(teamRoleId, orgId);
58+
const role = await this.roleRepository.findByIdAndOrgId(
59+
teamRoleId,
60+
orgId
61+
);
5962

6063
if (!role) {
6164
throw new ApiError("Role not found", 404);

server/src/services/business/MeService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class MeService implements IMeService {
7272
throw new ApiError("Organization not found");
7373
}
7474

75-
const orgRole = await this.roleRepository.findById(
75+
const orgRole = await this.roleRepository.findByIdAndOrgId(
7676
orgMembership.roleId || "",
7777
org.id
7878
);

0 commit comments

Comments
 (0)