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);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
joinTeam,
|
||||
requestToJoinTeam,
|
||||
leaveTeam,
|
||||
} from '@gridpilot/racing/application';
|
||||
} from '@/lib/racingLegacyFacade';
|
||||
|
||||
interface JoinTeamButtonProps {
|
||||
teamId: string;
|
||||
|
||||
@@ -5,7 +5,8 @@ import Card from '@/components/ui/Card';
|
||||
import Button from '@/components/ui/Button';
|
||||
import Input from '@/components/ui/Input';
|
||||
import { getDriverRepository } from '@/lib/di-container';
|
||||
import { EntityMappers, DriverDTO } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import { EntityMappers } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import type { DriverDTO } from '@gridpilot/racing/application/dto/DriverDTO';
|
||||
import {
|
||||
Team,
|
||||
TeamJoinRequest,
|
||||
@@ -13,7 +14,7 @@ import {
|
||||
approveTeamJoinRequest,
|
||||
rejectTeamJoinRequest,
|
||||
updateTeam,
|
||||
} from '@gridpilot/racing/application';
|
||||
} from '@/lib/racingLegacyFacade';
|
||||
|
||||
interface TeamAdminProps {
|
||||
team: Team;
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import Card from '@/components/ui/Card';
|
||||
import { getDriverRepository, getDriverStats } from '@/lib/di-container';
|
||||
import { EntityMappers, DriverDTO } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import { TeamMembership, TeamRole } from '@gridpilot/racing/application';
|
||||
import { EntityMappers } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import type { DriverDTO } from '@gridpilot/racing/application/dto/DriverDTO';
|
||||
import { TeamMembership, TeamRole } from '@/lib/racingLegacyFacade';
|
||||
|
||||
interface TeamRosterProps {
|
||||
teamId: string;
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import Card from '@/components/ui/Card';
|
||||
import { getStandingRepository, getLeagueRepository } from '@/lib/di-container';
|
||||
import { EntityMappers, LeagueDTO } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import { getTeamMembers } from '@gridpilot/racing/application';
|
||||
import { EntityMappers } from '@gridpilot/racing/application/mappers/EntityMappers';
|
||||
import type { LeagueDTO } from '@gridpilot/racing/application/dto/LeagueDTO';
|
||||
import { getTeamMembers } from '@/lib/racingLegacyFacade';
|
||||
|
||||
interface TeamStandingsProps {
|
||||
teamId: string;
|
||||
|
||||
Reference in New Issue
Block a user