feat(belo): add analysis page with historical stats, chart, and date range picker
This commit is contained in:
@@ -38,6 +38,13 @@ export type DailyQuote = {
|
||||
sell: number;
|
||||
};
|
||||
|
||||
export type HistoricalMinMax = {
|
||||
minBuy: number;
|
||||
maxBuy: number;
|
||||
minBuyDate: string | null;
|
||||
maxBuyDate: string | null;
|
||||
};
|
||||
|
||||
async function fetcher<T>(url: string): Promise<T> {
|
||||
const res = await fetch(url, { credentials: "include" });
|
||||
if (!res.ok) {
|
||||
@@ -94,6 +101,10 @@ export function getDailyQuotes(
|
||||
return fetcher<DailyQuote[]>(`/api/quotes/${type}/daily?${params}`);
|
||||
}
|
||||
|
||||
export function getHistoricalMinMax(type: string): Promise<HistoricalMinMax> {
|
||||
return fetcher<HistoricalMinMax>(`/api/quotes/${type}/historical/min-max`);
|
||||
}
|
||||
|
||||
// Expenses
|
||||
|
||||
export type PeriodicExpense = {
|
||||
|
||||
Reference in New Issue
Block a user