feat(frontend): logs pagination
This commit is contained in:
@@ -4,7 +4,7 @@ import type {
|
||||
CreateRuleRequest,
|
||||
UpdateRuleRequest,
|
||||
UpdateCommandRequest,
|
||||
RequestLog,
|
||||
RequestLogs,
|
||||
} from "../types";
|
||||
import { authStore } from "./auth";
|
||||
|
||||
@@ -107,7 +107,7 @@ export const authApi = {
|
||||
|
||||
// Logs API
|
||||
export const logsApi = {
|
||||
list: (params?: { method?: string; search?: string }) => {
|
||||
list: (params?: { method?: string; search?: string; page: number; limit: number }) => {
|
||||
const query = new URLSearchParams();
|
||||
if (params?.method) {
|
||||
query.set("method", params.method);
|
||||
@@ -116,6 +116,9 @@ export const logsApi = {
|
||||
query.set("search", params.search);
|
||||
}
|
||||
const queryString = query.toString();
|
||||
return request<RequestLog[]>(`/logs${queryString ? `?${queryString}` : ""}`);
|
||||
return request<RequestLogs>(`/logs${queryString ? `?${queryString}` : ""}`);
|
||||
},
|
||||
methods: () => {
|
||||
return request<string[]>("/logs/methods");
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user