diff --git a/src/views/accounts/AccountSetting.vue b/src/views/accounts/AccountSetting.vue index bfbfe10..40eea2c 100644 --- a/src/views/accounts/AccountSetting.vue +++ b/src/views/accounts/AccountSetting.vue @@ -19,21 +19,7 @@

-
-
-
-
- {{ user.userId }} - ( - {{ user.alias }} - - {{ user.email }} - ) -
-
-
-
+
{{ account.users.map(u => getUserInfo(u)).join(', ')}}

Ajouter des amis

@@ -164,15 +150,25 @@ export default class AccountSetting extends BaseAccount { return } this.account.users = [...this.account.users, ...this.newUsers] - const ok: boolean = await accountService.update(this.account._id, this.account) + const ok: boolean = await accountService.update( + this.account._id, + this.account + ) if (!ok) { notif.error(`Une erreur s'est produite.`) return } - notif.success(this.$tc('account.newUserAdded', this.newUsers.length).toString()) + notif.success( + this.$tc('account.newUserAdded', this.newUsers.length).toString() + ) this.newUsers = [] } + public getUserInfo(user: IUser): string { + const email = (user.email && ` - ${user.email}`) || '' + return `${user.alias} (${user.userId}${email})` + } + public validate(): boolean { if (!this.account) { return false