parent
fbbbaa5d49
commit
9bb027ec4c
@ -2,7 +2,10 @@
|
|||||||
import { _ } from "svelte-i18n";
|
import { _ } from "svelte-i18n";
|
||||||
import { clickOutside } from "./outsideclick";
|
import { clickOutside } from "./outsideclick";
|
||||||
import { focusTrap } from "svelte-focus-trap";
|
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";
|
import Toastify from "toastify-js";
|
||||||
export let modal_open;
|
export let modal_open;
|
||||||
export let current_teams;
|
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() {
|
function submit() {
|
||||||
if (processed_last_submit === true) {
|
if (processed_last_submit === true) {
|
||||||
processed_last_submit = false;
|
processed_last_submit = false;
|
||||||
@ -35,7 +49,10 @@
|
|||||||
text: "Team is being added...",
|
text: "Team is being added...",
|
||||||
duration: -1,
|
duration: -1,
|
||||||
}).showToast();
|
}).showToast();
|
||||||
RunnerTeamService.runnerTeamControllerPost({parentGroup:0,name})
|
RunnerTeamService.runnerTeamControllerPost({
|
||||||
|
parentGroup,
|
||||||
|
name: teamname,
|
||||||
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
console.log(result);
|
console.log(result);
|
||||||
teamname = "";
|
teamname = "";
|
||||||
@ -47,7 +64,7 @@
|
|||||||
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
backgroundColor: "linear-gradient(to right, #00b09b, #96c93d)",
|
||||||
}).showToast();
|
}).showToast();
|
||||||
current_teams.push(result);
|
current_teams.push(result);
|
||||||
current_teams=current_teams;
|
current_teams = current_teams;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
//
|
//
|
||||||
@ -131,6 +148,18 @@
|
|||||||
</span>
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-span-6">
|
||||||
|
<label
|
||||||
|
for="firstname"
|
||||||
|
class="block text-sm font-medium text-gray-700">{$_('organization')}</label>
|
||||||
|
<select
|
||||||
|
bind:value={parentGroup}
|
||||||
|
class="mt-1 focus:ring-indigo-500 focus:border-indigo-500 block w-full shadow-sm rounded-l-md sm:text-sm border-gray-300 border bg-gray-50 text-gray-500 dark:bg-gray-900 dark:text-gray-100 rounded-md p-2">
|
||||||
|
{#each teams as t}
|
||||||
|
<option value={t.id}>{t.name}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user