19 lines
522 B
TypeScript
19 lines
522 B
TypeScript
import apiClient from './client';
|
|
import type { ScoreResponse, RankingsResponse } from '../lib/types';
|
|
|
|
export function getScores(symbol: string) {
|
|
return apiClient
|
|
.get<ScoreResponse>(`scores/${symbol}`)
|
|
.then((r) => r.data);
|
|
}
|
|
|
|
export function getRankings() {
|
|
return apiClient.get<RankingsResponse>('rankings').then((r) => r.data);
|
|
}
|
|
|
|
export function updateWeights(weights: Record<string, number>) {
|
|
return apiClient
|
|
.put<{ message: string }>('scores/weights', { weights })
|
|
.then((r) => r.data);
|
|
}
|