import type { PaginatedResponse } from '@vector/shared'; import { api } from './client.js'; // Minimal helper: turn a filter object into a query-string payload, skipping undefined/null/'' // and coercing booleans/numbers cleanly. Reuse across resource fetchers to keep them tiny. export function toQueryParams(filters: Record = {}): Record { const out: Record = {}; for (const [k, v] of Object.entries(filters)) { if (v === undefined || v === null || v === '') continue; out[k] = String(v); } return out; } export async function getList( path: string, filters: Record = {}, ): Promise> { const res = await api.get>(path, { params: toQueryParams(filters) }); return res.data; }