import { apiClient } from './client';

export const authApi = {
  login: (username: string, password: string) =>
    apiClient.post<{ accessToken: string; admin: { id: string; username: string; role: string } }>('/auth/login', {
      username,
      password,
    }),

  getProfile: () =>
    apiClient.get<{ id: string; username: string; role: string }>('/auth/profile'),

  changePassword: (oldPassword: string, newPassword: string) =>
    apiClient.post('/auth/change-password', { oldPassword, newPassword }),
};
