From 45e7f6a0d1315db8779111545f317ba746680a28 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 13 Feb 2021 20:30:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20working=20AddContactModal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #50 --- src/components/AddContactModal.svelte | 7 +++---- src/components/Contacts.svelte | 5 ++--- src/components/ContactsOverview.svelte | 2 -- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/components/AddContactModal.svelte b/src/components/AddContactModal.svelte index 85115dea..7821a077 100644 --- a/src/components/AddContactModal.svelte +++ b/src/components/AddContactModal.svelte @@ -84,13 +84,12 @@ text: "Contact is being added...", duration: -1, }).showToast(); - const group=teams.concat(orgs).find(g=>g.id===selected_team) - console.log(group); + const groups=teams.concat(orgs).map(g=>g.id) let postdata = { - group: group, + groups: groups, firstname: firstname_input_value, lastname: lastname_input_value, - adress: { + address: { address1:address_input1_value, address2:address_input2_value||"", postalcode:address_zipcode_value, diff --git a/src/components/Contacts.svelte b/src/components/Contacts.svelte index f15451f9..17ae16a4 100644 --- a/src/components/Contacts.svelte +++ b/src/components/Contacts.svelte @@ -4,14 +4,13 @@ import AddContactModal from "./AddContactModal.svelte"; import ContactsOverview from "./ContactsOverview.svelte"; export let modal_open = false; - console.log(store.state.jwtinfo.userdetails.permissions); let current_contacts=[];
{$_('contacts')} - {#if store.state.jwtinfo.userdetails.permissions.includes('USER:CREATE')} + {#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:CREATE')}
-{#if store.state.jwtinfo.userdetails.permissions.includes('USER:CREATE')} +{#if store.state.jwtinfo.userdetails.permissions.includes('CONTACT:CREATE')} {/if} diff --git a/src/components/ContactsOverview.svelte b/src/components/ContactsOverview.svelte index 86546d2b..35538de8 100644 --- a/src/components/ContactsOverview.svelte +++ b/src/components/ContactsOverview.svelte @@ -24,7 +24,6 @@ {#if current_contacts.length === 0} {:else} - {JSON.stringify(current_contacts)}
- {t.address.address1}
{t.address.address2 || ''}
{t.address.postalcode}