diff --git a/src/components/admin/pages/event/modals/CreateFightModal.svelte b/src/components/admin/pages/event/modals/CreateFightModal.svelte
index a5a46bd..927d9d3 100644
--- a/src/components/admin/pages/event/modals/CreateFightModal.svelte
+++ b/src/components/admin/pages/event/modals/CreateFightModal.svelte
@@ -58,7 +58,7 @@
redTeam: parseInt(redTeam),
start: dayjs(start),
map,
- kampfleiter: parseInt(kampfleiter),
+ kampfleiter: parseInt(kampfleiter!),
group,
});
reset()
diff --git a/src/components/admin/pages/generate/GroupGenerator.svelte b/src/components/admin/pages/generate/GroupGenerator.svelte
index 89c64ff..f14b897 100644
--- a/src/components/admin/pages/generate/GroupGenerator.svelte
+++ b/src/components/admin/pages/generate/GroupGenerator.svelte
@@ -37,12 +37,12 @@
function dragToNewGroup(event: CustomEvent
) {
event.detail.preventDefault();
- let teamId = parseInt(event.detail.dataTransfer.getData("team"));
+ let teamId = parseInt(event.detail.dataTransfer!.getData("team"));
groups = [...groups.map(value => value.filter(value1 => value1 != teamId)), [teamId]].filter(value => value.length > 0);
}
function teamDragStart(ev: DragEvent, team: Team) {
- ev.dataTransfer.setData("team", team.id.toString())
+ ev.dataTransfer!.setData("team", team.id.toString())
}
let resetDragOver = false;
@@ -54,14 +54,14 @@
function dropReset(ev: DragEvent) {
ev.preventDefault();
- let teamId = parseInt(ev.dataTransfer.getData("team"));
+ let teamId = parseInt(ev.dataTransfer!.getData("team"));
groups = groups.map(group => group.filter(team => team !== teamId)).filter(group => group.length > 0);
resetDragOver = false;
}
function dropGroup(ev: CustomEvent, groupIndex: number) {
ev.preventDefault();
- let teamId = parseInt(ev.detail.dataTransfer.getData("team"));
+ let teamId = parseInt(ev.detail.dataTransfer!.getData("team"));
groups = groups.map((group, i) => i === groupIndex ? [...group.filter(value => value != teamId), teamId] : group.filter(value => value != teamId)).filter(group => group.length > 0);
}
@@ -104,8 +104,8 @@
groups = groups.filter(group => group.length > 0);
}
- function generateGroups(groups): number[][][][] {
- let groupFights = [];
+ function generateGroups(groups: number[][]): number[][][][] {
+ const groupFights: number[][][][] = [];
groups.forEach((group) => {
let round = group.length + (group.length % 2) - 1;
let groupFight = [];
@@ -138,8 +138,8 @@
groupsFights.forEach((group, i) => {
group.forEach((round, j) => {
round.forEach(async (fight, k) => {
- let blueTeam = teams.get(fight[0])
- let redTeam = teams.get(fight[1])
+ const blueTeam = teams.get(fight[0])!
+ const redTeam = teams.get(fight[1])!
await $fightRepo.createFight(data.event.id, {
blueTeam: blueTeam.id,
@@ -160,7 +160,7 @@
resetDragOver = false} on:drop={dropReset} role="group">
- {#each teamsNotInGroup as team}
+ {#each teamsNotInGroup as team (team.id)}
teamDragStart(ev, team)}/>
{/each}
@@ -171,10 +171,10 @@
- {#each groups as group, i}
+ {#each groups as group, i (i)}
dropGroup(ev, i)}>
Group {i + 1} ({group.length})
- {#each group as teamId}
+ {#each group as teamId (teamId)}
teamDragStart(ev, teams.get(teamId))}/>
{/each}
diff --git a/src/components/dashboard/SchematicList.svelte b/src/components/dashboard/SchematicList.svelte
index 5e770be..9322cb0 100644
--- a/src/components/dashboard/SchematicList.svelte
+++ b/src/components/dashboard/SchematicList.svelte
@@ -81,7 +81,7 @@
dispatch("reset")} class="hover:underline hover:cursor-pointer text-2xl">{t("dashboard.schematic.home")}
- {#each schematics.breadcrumbs as bread}
+ {#each schematics.breadcrumbs as bread (bread.id)}
@@ -141,7 +141,7 @@
|