Refactor EventFight handling to include team relation names and update type definitions
SteamWarCI Build successful
SteamWarCI Build successful
This commit is contained in:
@@ -20,9 +20,9 @@
|
||||
import { Checkbox } from "@components/ui/checkbox";
|
||||
import { renderComponent } from "@components/ui/data-table";
|
||||
import type { ColumnDef } from "@tanstack/table-core";
|
||||
import type { EventFight } from "@type/event.ts";
|
||||
import type { EventFightModel } from "./eventmodel.svelte";
|
||||
|
||||
export const columns: ColumnDef<EventFight> = [
|
||||
export const columns: ColumnDef<EventFightModel>[] = [
|
||||
{
|
||||
id: "auswahl",
|
||||
header: ({ table }) => {
|
||||
@@ -32,7 +32,7 @@ export const columns: ColumnDef<EventFight> = [
|
||||
onCheckedChange: () => {
|
||||
if (!table.getIsSomeRowsSelected() && !table.getIsAllRowsSelected()) {
|
||||
const now = new Date();
|
||||
const rows = table.getRowModel().rows.filter((row) => new Date(row.original.date) > now);
|
||||
const rows = table.getRowModel().rows.filter((row) => new Date(row.original.start) > now);
|
||||
|
||||
if (rows.length > 0) {
|
||||
rows.forEach((row) => {
|
||||
@@ -57,7 +57,7 @@ export const columns: ColumnDef<EventFight> = [
|
||||
},
|
||||
},
|
||||
{
|
||||
accessorFn: (r) => r.blueTeam.name + " vs " + r.redTeam.name,
|
||||
accessorFn: (r) => r.blueTeam.nameWithRelation + " vs " + r.redTeam.nameWithRelation,
|
||||
id: "begegnung",
|
||||
header: "Begegnung",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user