improve moderation log
This commit is contained in:
parent
ed53b5f9bc
commit
2ad3b1fd74
5 changed files with 22 additions and 9 deletions
|
@ -493,6 +493,19 @@ export class RoleService implements OnApplicationShutdown {
|
|||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public async delete(role: MiRole, moderator?: MiUser): Promise<void> {
|
||||
await this.rolesRepository.delete({ id: role.id });
|
||||
this.globalEventService.publishInternalEvent('roleDeleted', role);
|
||||
|
||||
if (moderator) {
|
||||
this.moderationLogService.log(moderator, 'deleteRole', {
|
||||
roleId: role.id,
|
||||
role: role,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public dispose(): void {
|
||||
this.redisForSub.off('message', this.onMessage);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue