first commit
This commit is contained in:
18
frontend/src/api/scores.ts
Normal file
18
frontend/src/api/scores.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user