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

export function login(username: string, password: string) {
  return apiClient
    .post<TokenResponse>('auth/login', { username, password })
    .then((r) => r.data);
}

export function register(username: string, password: string) {
  return apiClient
    .post<{ message: string }>('auth/register', { username, password })
    .then((r) => r.data);
}
