feat: 添加货币管理功能,更新国际化支持,移除报表相关代码
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
import { adminHttp, adminRequest } from "@/lib/admin-http";
|
||||
import { withAdminAuthHeader } from "@/lib/admin-auth";
|
||||
import { withAdminLocaleHeaders } from "@/lib/admin-locale";
|
||||
|
||||
import { API_V1_PREFIX } from "./paths";
|
||||
|
||||
import type {
|
||||
AdminReportJobCreateResponse,
|
||||
AdminReportJobListData,
|
||||
} from "@/types/api/admin-reports";
|
||||
|
||||
const A = `${API_V1_PREFIX}/admin`;
|
||||
|
||||
export async function getAdminReportJobs(params?: {
|
||||
page?: number;
|
||||
per_page?: number;
|
||||
}): Promise<AdminReportJobListData> {
|
||||
return adminRequest.get<AdminReportJobListData>(`${A}/report-jobs`, {
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function postAdminReportJob(body: {
|
||||
report_type: string;
|
||||
export_format?: "csv" | "xlsx";
|
||||
parameters?: Record<string, unknown> | null;
|
||||
filter_json?: Record<string, unknown> | null;
|
||||
}): Promise<AdminReportJobCreateResponse> {
|
||||
return adminRequest.post<AdminReportJobCreateResponse>(
|
||||
`${A}/report-jobs`,
|
||||
body,
|
||||
);
|
||||
}
|
||||
|
||||
export async function downloadAdminReportJob(jobId: number): Promise<Blob> {
|
||||
const res = await adminHttp.request<Blob>(
|
||||
withAdminAuthHeader(withAdminLocaleHeaders({
|
||||
url: `${A}/report-jobs/${jobId}/download`,
|
||||
method: "GET",
|
||||
responseType: "blob",
|
||||
})),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
Reference in New Issue
Block a user