feat: add profile settings page and fixed-taxonomy WorkoutKinds UI with pace/HR-zone editing
This commit is contained in:
@@ -2,6 +2,7 @@ import type {
|
||||
Activity,
|
||||
AuthResponse,
|
||||
KindAssignment,
|
||||
Profile,
|
||||
ProgressionMetric,
|
||||
ProgressionPoint,
|
||||
ReviewQueueItem,
|
||||
@@ -50,19 +51,31 @@ export const api = {
|
||||
getActivity: (id: number) =>
|
||||
request<{ activity: Activity; laps: unknown[]; assignment?: KindAssignment }>(`/api/activities/${id}`),
|
||||
|
||||
// Workout kinds
|
||||
// Workout kinds -- fixed taxonomy, no create/delete
|
||||
listWorkoutKinds: (includeInactive = false) =>
|
||||
request<WorkoutKind[]>(`/api/workout-kinds/${includeInactive ? "?include_inactive=true" : ""}`),
|
||||
createWorkoutKind: (body: { name: string; description?: string; color?: string; rule: unknown; priority?: number }) =>
|
||||
request<WorkoutKind>("/api/workout-kinds/", { method: "POST", body: JSON.stringify(body) }),
|
||||
updateWorkoutKind: (
|
||||
id: number,
|
||||
body: { name: string; description?: string; color?: string; rule: unknown; priority?: number; is_active?: boolean },
|
||||
body: {
|
||||
name: string;
|
||||
description?: string;
|
||||
color?: string;
|
||||
rule: unknown;
|
||||
priority?: number;
|
||||
is_active?: boolean;
|
||||
pace_min_sec_per_km?: number | null;
|
||||
pace_max_sec_per_km?: number | null;
|
||||
expected_hr_zone?: number | null;
|
||||
},
|
||||
) => request<WorkoutKind>(`/api/workout-kinds/${id}`, { method: "PUT", body: JSON.stringify(body) }),
|
||||
deleteWorkoutKind: (id: number) => request<void>(`/api/workout-kinds/${id}`, { method: "DELETE" }),
|
||||
reclassifyWorkoutKind: (id: number) =>
|
||||
request<{ reclassified: number }>(`/api/workout-kinds/${id}/reclassify`, { method: "POST" }),
|
||||
|
||||
// Profile
|
||||
getProfile: () => request<Profile>("/api/profile"),
|
||||
updateProfile: (profile: Profile) =>
|
||||
request<Profile>("/api/profile", { method: "PUT", body: JSON.stringify(profile) }),
|
||||
|
||||
// Review queue
|
||||
reviewQueue: () => request<ReviewQueueItem[]>("/api/review-queue/"),
|
||||
resolveReview: (activityId: number, workoutKindId: number) =>
|
||||
|
||||
Reference in New Issue
Block a user