mirror of
https://gitlab.com/mobicoop/v3/service/auth.git
synced 2026-04-05 05:00:21 +00:00
use new integration events
This commit is contained in:
@@ -13,10 +13,10 @@ export class UserDeletedMessageHandler {
|
||||
public async userDeleted(message: string) {
|
||||
const deletedUser = JSON.parse(message);
|
||||
try {
|
||||
if (!deletedUser.hasOwnProperty('userId')) throw new Error();
|
||||
if (!deletedUser.hasOwnProperty('id')) throw new Error();
|
||||
await this.commandBus.execute(
|
||||
new DeleteAuthenticationCommand({
|
||||
userId: deletedUser.userId,
|
||||
userId: deletedUser.id,
|
||||
}),
|
||||
);
|
||||
} catch (e: any) {}
|
||||
|
||||
@@ -14,11 +14,11 @@ export class UserUpdatedMessageHandler {
|
||||
public async userUpdated(message: string) {
|
||||
const updatedUser = JSON.parse(message);
|
||||
try {
|
||||
if (!updatedUser.hasOwnProperty('userId')) throw new Error();
|
||||
if (!updatedUser.hasOwnProperty('id')) throw new Error();
|
||||
if (updatedUser.hasOwnProperty('email') && updatedUser.email) {
|
||||
await this.commandBus.execute(
|
||||
new UpdateUsernameCommand({
|
||||
userId: updatedUser.userId,
|
||||
userId: updatedUser.id,
|
||||
username: {
|
||||
name: updatedUser.email,
|
||||
type: Type.EMAIL,
|
||||
@@ -29,7 +29,7 @@ export class UserUpdatedMessageHandler {
|
||||
if (updatedUser.hasOwnProperty('phone') && updatedUser.phone) {
|
||||
await this.commandBus.execute(
|
||||
new UpdateUsernameCommand({
|
||||
userId: updatedUser.userId,
|
||||
userId: updatedUser.if,
|
||||
username: {
|
||||
name: updatedUser.phone,
|
||||
type: Type.PHONE,
|
||||
|
||||
Reference in New Issue
Block a user