refactor(core): Decouple event bus from internal hooks (no-changelog) (#9724)

This commit is contained in:
Iván Ovejero
2024-06-20 12:32:22 +02:00
committed by GitHub
parent e4463c62b4
commit 199dff4fb3
29 changed files with 1028 additions and 664 deletions

View File

@@ -18,6 +18,7 @@ import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { InternalHooks } from '@/InternalHooks';
import { ExternalHooks } from '@/ExternalHooks';
import { EventRelay } from '@/eventbus/event-relay.service';
@RestController('/invitations')
export class InvitationController {
@@ -31,6 +32,7 @@ export class InvitationController {
private readonly passwordUtility: PasswordUtility,
private readonly userRepository: UserRepository,
private readonly postHog: PostHogClient,
private readonly eventRelay: EventRelay,
) {}
/**
@@ -170,6 +172,7 @@ export class InvitationController {
user_type: 'email',
was_disabled_ldap_user: false,
});
this.eventRelay.emit('user-signed-up', { user: updatedUser });
const publicInvitee = await this.userService.toPublic(invitee);