This commit is contained in:
2025-12-04 17:07:59 +01:00
parent 60a3c82cd9
commit 88c6befc7c
33 changed files with 602 additions and 261 deletions

View File

@@ -4,7 +4,7 @@ import { useState } from 'react';
import { useRouter } from 'next/navigation';
import Button from '@/components/ui/Button';
import Input from '@/components/ui/Input';
import { createTeam, getCurrentDriverId } from '@gridpilot/racing/application';
import { createTeam, getCurrentDriverId } from '@/lib/racingLegacyFacade';
interface CreateTeamFormProps {
onCancel?: () => void;
@@ -56,14 +56,13 @@ export default function CreateTeamForm({ onCancel, onSuccess }: CreateTeamFormPr
setSubmitting(true);
try {
const currentDriverId = getCurrentDriverId();
const team = createTeam(
formData.name,
formData.tag.toUpperCase(),
formData.description,
currentDriverId,
[] // Empty leagues array for now
);
getCurrentDriverId(); // ensure identity initialized
const team = createTeam({
name: formData.name,
tag: formData.tag.toUpperCase(),
description: formData.description,
leagues: [],
});
if (onSuccess) {
onSuccess(team.id);