Big refactoring
This commit is contained in:
@@ -1,7 +1,20 @@
|
||||
import apiClient from './client';
|
||||
|
||||
export interface IngestionSourceResult {
|
||||
status: 'ok' | 'error' | 'skipped';
|
||||
message?: string | null;
|
||||
records?: number;
|
||||
classification?: string;
|
||||
confidence?: number;
|
||||
}
|
||||
|
||||
export interface FetchDataResult {
|
||||
symbol: string;
|
||||
sources: Record<string, IngestionSourceResult>;
|
||||
}
|
||||
|
||||
export function fetchData(symbol: string) {
|
||||
return apiClient
|
||||
.post<{ message: string }>(`ingestion/fetch/${symbol}`)
|
||||
.post<FetchDataResult>(`ingestion/fetch/${symbol}`)
|
||||
.then((r) => r.data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user