geo/frontend/lib/api/reports.ts

13 lines
474 B
TypeScript

import { fetchWithAuth } from "./client";
export const reportsApi = {
exportCSV: (token: string, queryId?: string) => {
const query = queryId ? `?query_id=${queryId}` : "";
return fetchWithAuth(`/api/v1/reports/export/csv${query}`, {}, token, "blob");
},
exportPDF: async (token: string, queryId?: string) => {
const query = queryId ? `?query_id=${queryId}` : "";
return fetchWithAuth(`/api/v1/reports/export/pdf${query}`, {}, token, "blob");
},
};