refactor(core): Rename EventRelay to EventService (no-changelog) (#10110)

This commit is contained in:
Iván Ovejero
2024-07-19 12:55:38 +02:00
committed by GitHub
parent 222a0862bd
commit aba1c64500
36 changed files with 203 additions and 195 deletions

View File

@@ -12,7 +12,7 @@ import { InternalHooks } from '@/InternalHooks';
import { UrlService } from '@/services/url.service';
import type { UserRequest } from '@/requests';
import { InternalServerError } from '@/errors/response-errors/internal-server.error';
import { EventRelay } from '@/eventbus/event-relay.service';
import { EventService } from '@/eventbus/event.service';
@Service()
export class UserService {
@@ -21,7 +21,7 @@ export class UserService {
private readonly userRepository: UserRepository,
private readonly mailer: UserManagementMailer,
private readonly urlService: UrlService,
private readonly eventRelay: EventRelay,
private readonly eventService: EventService,
) {}
async update(userId: string, data: Partial<User>) {
@@ -158,7 +158,7 @@ export class UserService {
email_sent: result.emailSent,
invitee_role: role, // same role for all invited users
});
this.eventRelay.emit('user-invited', {
this.eventService.emit('user-invited', {
user: owner,
targetUserId: Object.values(toInviteUsers),
});
@@ -169,7 +169,7 @@ export class UserService {
message_type: 'New user invite',
public_api: false,
});
this.eventRelay.emit('email-failed', { user: owner, messageType: 'New user invite' });
this.eventService.emit('email-failed', { user: owner, messageType: 'New user invite' });
this.logger.error('Failed to send email', {
userId: owner.id,
inviteAcceptUrl,