feat(core): Add user.profile.beforeUpdate hook (#8144)

Add `user.profile.beforeUpdate` hook so we can prevent user email change
if it overlaps with other users email.
This commit is contained in:
Tomi Turtiainen
2024-01-02 10:15:12 +02:00
committed by GitHub
parent ece48d6a13
commit e126ed74f3
3 changed files with 53 additions and 1 deletions

View File

@@ -73,6 +73,8 @@ export class MeController {
}
}
await this.externalHooks.run('user.profile.beforeUpdate', [userId, currentEmail, payload]);
await this.userService.update(userId, payload);
const user = await this.userService.findOneOrFail({ where: { id: userId } });