Replace per-kind reclassify with a single global reclassify that respects manual and Race locks
Manual assignments are the user's definitive word and Race assignments come from a hard Garmin fact (eventType.typeKey), not a retunable rule -- neither is ever touched by reclassify again, and Race can no longer be set by hand via the review queue. Adds an Activities page so this locked/unlocked status is visible per workout, since Review Queue only ever showed unresolved items.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type {
|
||||
Activity,
|
||||
ActivityListItem,
|
||||
AuthResponse,
|
||||
KindAssignment,
|
||||
Profile,
|
||||
@@ -46,7 +47,7 @@ export const api = {
|
||||
if (params?.to) q.set("to", params.to);
|
||||
if (params?.limit) q.set("limit", String(params.limit));
|
||||
const qs = q.toString();
|
||||
return request<Activity[]>(`/api/activities/${qs ? `?${qs}` : ""}`);
|
||||
return request<ActivityListItem[]>(`/api/activities/${qs ? `?${qs}` : ""}`);
|
||||
},
|
||||
getActivity: (id: number) =>
|
||||
request<{ activity: Activity; laps: unknown[]; assignment?: KindAssignment }>(`/api/activities/${id}`),
|
||||
@@ -68,8 +69,10 @@ export const api = {
|
||||
expected_hr_zone?: number | null;
|
||||
},
|
||||
) => request<WorkoutKind>(`/api/workout-kinds/${id}`, { method: "PUT", body: JSON.stringify(body) }),
|
||||
reclassifyWorkoutKind: (id: number) =>
|
||||
request<{ reclassified: number }>(`/api/workout-kinds/${id}/reclassify`, { method: "POST" }),
|
||||
|
||||
// Reclassifies every activity that isn't locked (manual assignments and
|
||||
// Race assignments are never touched -- see handleReclassifyAll).
|
||||
reclassifyAll: () => request<{ reclassified: number }>("/api/reclassify", { method: "POST" }),
|
||||
|
||||
// Profile
|
||||
getProfile: () => request<Profile>("/api/profile"),
|
||||
|
||||
Reference in New Issue
Block a user