Files
live-hub-py/web/frontend/src/api/accountCheck.ts
T

14 lines
657 B
TypeScript

import api from './client';
import type { AccountCheckBatch, AccountCheckBatchRequest, MessageResponse } from './types';
export const accountCheckApi = {
start: (data: AccountCheckBatchRequest) =>
api.post<AccountCheckBatch, AccountCheckBatch>('/account-check/batches', data),
getBatch: (batchId: string) =>
api.get<AccountCheckBatch, AccountCheckBatch>(`/account-check/batches/${batchId}`),
stop: (batchId: string) =>
api.post<MessageResponse, MessageResponse>(`/account-check/batches/${batchId}/stop`),
download: (batchId: string) =>
api.get<Blob, Blob>(`/account-check/batches/${batchId}/download`, { responseType: 'blob' }),
};