import http, { call } from './request' import type { ApiResponse, LoginRequest, LoginResponse, UserCreate, UserListItem, UserListPage, UserQuery, UserUpdate } from './types' export function login(req: LoginRequest) { return call(() => http.post>('/auth/login', req)) } export function listUsers(q: UserQuery) { return call(() => http.get>('/users', { params: q }), ) } export function createUser(body: UserCreate) { return call(() => http.post>('/users', body)) } export function updateUser(id: number, body: UserUpdate) { return call(() => http.put>(`/users/${id}`, body)) }