import { get, post, put, del } from './apiClient';
import type { UserDetail, CreateUserRequest, UpdateUserRequest } from '../types/user';

export const getUsers = () => get<UserDetail[]>('/users');
export const getUser = (id: number) => get<UserDetail>(`/users/${id}`);
export const createUser = (req: CreateUserRequest) => post<UserDetail>('/users', req);
export const updateUser = (id: number, req: UpdateUserRequest) => put<UserDetail>(`/users/${id}`, req);
export const deactivateUser = (id: number) => del<void>(`/users/${id}`);
