From 9bb027ec4c73483907d396180f739dc3a11b2404 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Fri, 15 Jan 2021 21:22:37 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20AddTeamModal=20working?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #14 --- src/components/AddTeamModal.svelte | 51 +++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/src/components/AddTeamModal.svelte b/src/components/AddTeamModal.svelte index aeff59c8..57b1e3db 100644 --- a/src/components/AddTeamModal.svelte +++ b/src/components/AddTeamModal.svelte @@ -2,7 +2,10 @@ import { _ } from "svelte-i18n"; import { clickOutside } from "./outsideclick"; import { focusTrap } from "svelte-focus-trap"; - import { RunnerTeamService } from "@odit/lfk-client-js"; + import { + RunnerOrganisationService, + RunnerTeamService, + } from "@odit/lfk-client-js"; import Toastify from "toastify-js"; export let modal_open; export let current_teams; @@ -28,6 +31,17 @@ } }; })(); + $: teams = []; + $: parentGroup = undefined; + const orgs_promise = RunnerOrganisationService.runnerOrganisationControllerGetAll().then( + (val) => { + console.log(val); + teams = val; + val.forEach((t) => { + console.log(t.name); + }); + } + ); function submit() { if (processed_last_submit === true) { processed_last_submit = false; @@ -35,7 +49,10 @@ text: "Team is being added...", duration: -1, }).showToast(); - RunnerTeamService.runnerTeamControllerPost({parentGroup:0,name}) + RunnerTeamService.runnerTeamControllerPost({ + parentGroup, + name: teamname, + }) .then((result) => { console.log(result); teamname = ""; @@ -47,7 +64,7 @@ backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)", }).showToast(); current_teams.push(result); - current_teams=current_teams; + current_teams = current_teams; }) .catch((err) => { // @@ -89,14 +106,14 @@
+ class="h-6 w-6 text-blue-600" + fill="currentColor" + width="24" + height="24" + xmlns="http://www.w3.org/2000/svg" + viewBox="0 0 640 512">

@@ -131,6 +148,18 @@ {/if}

+
+ + +