Refactor event handling and introduce TeamSelector component for improved fight management
All checks were successful
SteamWarCI Build successful

This commit is contained in:
2025-09-28 10:26:08 +02:00
parent 54d49cca5b
commit c0f4a852b5
8 changed files with 320 additions and 172 deletions

View File

@@ -134,7 +134,7 @@
<DialogTitle>Fight Erstellen</DialogTitle>
<DialogDescription>Hier kannst du einen neuen Fight erstellen</DialogDescription>
</DialogHeader>
<FightEdit fight={null} teams={data.teams} event={data.event} groups={data.groups} onSave={handleSave}>
<FightEdit fight={null} {data} onSave={handleSave}>
{#snippet actions(dirty, submit)}
<DialogFooter>
<Button disabled={!dirty} onclick={submit}>Speichern</Button>
@@ -291,14 +291,7 @@
</TableCell>
{/each}
<TableCell class="text-right">
<FightEditRow
fight={row.original}
teams={data.teams}
bind:groups={data.groups}
event={data.event}
onupdate={(update) => (data.fights = data.fights.map((v) => (v.id === update.id ? update : v)))}
{refresh}
></FightEditRow>
<FightEditRow fight={row.original} {data} onupdate={(update) => (data._fights = data._fights.map((v) => (v.id === update.id ? update : v)))} {refresh}></FightEditRow>
</TableCell>
</TableRow>
{/each}