- 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
12 lines
500 B
TypeScript
12 lines
500 B
TypeScript
import { requireOwner } from '#lib/server/owner.js';
|
|
import type { LayoutServerLoad } from './$types';
|
|
|
|
// Owner only: everyone else (logged out, or any other account) gets a plain 404.
|
|
// Form actions don't run this load, so +page.server.ts checks again in every action,
|
|
// and hooks.server.ts blocks the whole /trackers/health prefix as a backstop.
|
|
export const load: LayoutServerLoad = (event) => {
|
|
requireOwner(event);
|
|
event.setHeaders({ 'cache-control': 'private, no-store' });
|
|
return {};
|
|
};
|