Add private health tracker (owner-only)
- health schema: vaccinations, body_measurements, workouts, nutrition_daily, sleep (generated hours), medications, hair_progress, appointments - migration with updated_at triggers; grants to personal_app only - /trackers/health overview with add/edit/delete, owner-gated (404 otherwise), noindex + private no-store, hidden from listings for non-owners - owner-only JSON/CSV import endpoint and scripts/health-import.ts
This commit is contained in:
@@ -71,3 +71,19 @@ export const trackers = [
|
||||
external: false
|
||||
}
|
||||
] as const;
|
||||
|
||||
// Owner-only trackers: shown in the header, home page and /trackers only to the logged-in
|
||||
// owner (layout data `isOwner`), never in the sitemap. Their routes 404 for everyone else.
|
||||
export const privateTrackers = [
|
||||
{
|
||||
name: 'health',
|
||||
subtitle: 'private: body, workouts, sleep, meds and vaccinations',
|
||||
href: '/trackers/health',
|
||||
external: false
|
||||
}
|
||||
] as const;
|
||||
|
||||
type Tracker = { name: string; subtitle: string; href: string; external: boolean };
|
||||
export function visibleTrackers(isOwner: boolean): readonly Tracker[] {
|
||||
return isOwner ? [...trackers, ...privateTrackers] : trackers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user