import http from './http';

export interface Todo {
  userId: number;
  id: number;
  title: string;
  completed: boolean;
}

export async function fetchTodo(id: number): Promise<Todo> {
  const response = await http.get<Todo>(`/todos/${id}`);
  return response.data;
}

export default http;
