wip
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user