import type { CreateSportInput, Sport, UpdateSportInput } from '@repo/api-contract';
import { http } from '../http';

export async function list() {
  const response = await http.get<Sport[]>('/api/sports');
  return response.data;
}

export async function create(payload: CreateSportInput) {
  const response = await http.post<Sport>('/api/sports', payload);
  return response.data;
}

export async function update(id: string, payload: UpdateSportInput) {
  const response = await http.patch<Sport>(`/api/sports/${id}`, payload);
  return response.data;
}
