refactor(core): Decouple user events from internal hooks (no-changelog) (#10292)

This commit is contained in:
Iván Ovejero
2024-08-05 12:07:42 +02:00
committed by GitHub
parent 88086a41ff
commit c0f3693e8a
15 changed files with 260 additions and 181 deletions

View File

@@ -151,16 +151,12 @@ export class UserService {
});
}
Container.get(InternalHooks).onUserInvite({
user: owner,
target_user_id: Object.values(toInviteUsers),
public_api: false,
email_sent: result.emailSent,
invitee_role: role, // same role for all invited users
});
this.eventService.emit('user-invited', {
user: owner,
targetUserId: Object.values(toInviteUsers),
publicApi: false,
emailSent: result.emailSent,
inviteeRole: role, // same role for all invited users
});
} catch (e) {
if (e instanceof Error) {