Skip to content

Commit c640fa1

Browse files
committed
fix: list role names in log message
1 parent bc3f090 commit c640fa1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libs/api/role/data-access/src/lib/api-role-resolver.service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ export class ApiRoleResolverService {
213213
const deleted = await this.core.data.communityMemberRole.deleteMany({
214214
where: { member: { communityId, userId }, roleId: role.id },
215215
})
216-
await this.core.logInfo(`Role revoked`, {
216+
const roleName = roles.find((r) => r.id === role.id)?.name
217+
await this.core.logInfo(`Role revoked: ${roleName}`, {
217218
userId,
218219
communityId,
219220
relatedId: role.id,
@@ -228,7 +229,7 @@ export class ApiRoleResolverService {
228229
member: { connect: { communityId_userId: { communityId, userId } } },
229230
},
230231
})
231-
await this.core.logInfo(`Role granted`, {
232+
await this.core.logInfo(`Role granted: ${role.name}`, {
232233
userId,
233234
communityId,
234235
relatedId: role.id,

0 commit comments

Comments
 (0)