import axios from "@/config/axios"; import { API_ENDPOINTS } from "@/config/api"; import type { PageResult, Audits } from "@/types/audit"; export async function getAudits( pageNumber = 1, pageSize = 20, username?: string | null, action?: string | null, from?: string | null, to?: string | null ): Promise> { const response = await axios.get>(API_ENDPOINTS.AUDIT.GET_AUDITS, { params: { pageNumber, pageSize, username, action, from, to }, }); // API trả về camelCase khớp với PageResult — dùng trực tiếp, không cần map return response.data; }