fixed reminder

This commit is contained in:
2026-06-11 12:22:37 +03:00
parent 4108d737e3
commit 41cbef61a9
12 changed files with 410 additions and 59 deletions
+28
View File
@@ -168,9 +168,26 @@ export interface FitnessReminder {
enabled: boolean;
}
export interface FitnessDayOverview {
date: string;
has_data: boolean;
totals: FitnessDailySummary["totals"];
targets: FitnessDailySummary["targets"];
meal_count: number;
workout_count: number;
}
export interface FitnessHistory {
start_date: string;
end_date: string;
days: number;
summaries: FitnessDayOverview[];
}
export interface FitnessSnapshot {
profile: FitnessProfile | null;
today: FitnessDailySummary;
history?: FitnessHistory;
body_metrics: BodyMetric[];
reminders: FitnessReminder[];
}
@@ -355,6 +372,17 @@ export const api = {
getFitnessSnapshot: () => request<FitnessSnapshot>("/api/v1/fitness"),
getFitnessSummary: (day?: string) =>
request<FitnessDailySummary>(
`/api/v1/fitness/summary${day ? `?day=${encodeURIComponent(day)}` : ""}`
),
getFitnessHistory: (days = 7, end?: string) => {
const params = new URLSearchParams({ days: String(days) });
if (end) params.set("end", end);
return request<FitnessHistory>(`/api/v1/fitness/history?${params}`);
},
updateFitnessProfile: (updates: Partial<FitnessProfile>) =>
request<{ ok: boolean; profile: FitnessProfile }>("/api/v1/fitness/profile", {
method: "PUT",