From 182d108b876fcb24e6b72247f732cfdfa4d35199 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Fri, 21 Jun 2024 07:12:48 +0500 Subject: [PATCH] Remove accounts with same employee in settings (#5876) --- .../src/components/Owners.svelte | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/plugins/setting-resources/src/components/Owners.svelte b/plugins/setting-resources/src/components/Owners.svelte index a549801de2..1df7043632 100644 --- a/plugins/setting-resources/src/components/Owners.svelte +++ b/plugins/setting-resources/src/components/Owners.svelte @@ -13,8 +13,8 @@ // limitations under the License. -->
@@ -53,27 +59,23 @@
- {#each accounts as account (account._id)} - {@const employee = $personByIdStore.get(account.person)} - {#if employee?.name?.includes(search)} + {#each employees as employee (employee._id)} + {@const acc = accounts.find((p) => p.person === employee._id)} + {#if acc && employee.name?.includes(search)}
- {#if employee} - - {:else} - {account.email} - {/if} +
{ - void change(account, e.detail) + void change(acc, e.detail) }} />