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 @@