fixed reminder
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user