diff --git a/src/components/ContactDetail.svelte b/src/components/ContactDetail.svelte index aa9fe042..49322df5 100644 --- a/src/components/ContactDetail.svelte +++ b/src/components/ContactDetail.svelte @@ -10,10 +10,16 @@ import Toastify from "toastify-js"; import PromiseError from "./PromiseError.svelte"; import isEmail from "validator/es/lib/isEmail"; + $: address_checked = true; let data_loaded = false; let orgs = []; let teams = []; + let address_input1; + let address_input2; + let address_zipcode; + let address_city; $: address_input1_value = ""; + $: address_input2_value = ""; $: address_zipcode_value = ""; $: address_city_value = ""; export let params; @@ -41,8 +47,8 @@ promise.then((data) => { data_loaded = true; original_data = Object.assign(original_data, data); - original_data.group = original_data.group.id; editable = Object.assign(editable, original_data); + address_checked = editable.address1 === null; }); RunnerOrganizationService.runnerOrganizationControllerGetAll().then((val) => { orgs = val; @@ -51,7 +57,7 @@ teams = val; }); $: isPhoneValidOrEmpty = - (editable.phone.includes("+") && + (editable.phone?.includes("+") && isMobilePhone( editable.phone .replaceAll("(", "") @@ -279,6 +285,101 @@ {/each} + +
+
+ +
+
+ +
+
+ {#if address_checked === true} +
+ + + {#if !isAddress1Valid} + + Address is required + + {/if} +
+
+ + +
+
+ + + {#if !iszipcodevalid} + + Valid zipcode/ postal code is required + + {/if} +
+
+ + + {#if !iscityvalid} + + Valid city is required + + {/if} +
+ {/if} {:catch error}