import apiClient from './client';
import type { WatchlistEntry } from '../lib/types';

export function list() {
  return apiClient.get<WatchlistEntry[]>('watchlist').then((r) => r.data);
}

export function add(symbol: string) {
  return apiClient
    .post<WatchlistEntry>(`watchlist/${symbol}`)
    .then((r) => r.data);
}

export function remove(symbol: string) {
  return apiClient
    .delete<{ message: string }>(`watchlist/${symbol}`)
    .then((r) => r.data);
}
