Files
OpenFlare/openflare_server/web/features/access-logs/api/access-logs.ts
T
2026-03-15 16:26:56 +08:00

16 lines
518 B
TypeScript

import { apiRequest } from '@/lib/api/client';
import type { AccessLogList } from '@/features/access-logs/types';
export function getAccessLogs(page: number, nodeId?: string, pageSize = 50) {
const normalizedNodeId = nodeId?.trim();
const searchParams = new URLSearchParams({
p: String(Math.max(page, 0)),
page_size: String(pageSize),
});
if (normalizedNodeId) {
searchParams.set('node_id', normalizedNodeId);
}
return apiRequest<AccessLogList>(`/access-logs/?${searchParams.toString()}`);
}