Files
solelog/apps/worker/src/api/me.ts
Bas van Rossem 1631c1698d feat(worker): add logout + replace admin-only settings with Account screen
The Instellingen tab was activity management, which Phase 2 made admin-only —
workers saw add/edit/delete controls that all 403. Replace it with an Account
tab showing the signed-in name/email (via /api/me) and an Uitloggen button
(wires the existing AuthContext signOut). Activity management belongs to the
Phase 3 admin app, so the worker client drops the Settings screen and its
now-unused activity-mutation hooks (useActivities read stays).

Products affected: SoleLog worker client (apps/worker).
2026-06-17 18:23:42 +02:00

12 lines
338 B
TypeScript

import { useQuery } from '@tanstack/react-query';
import type { MeResponse } from '@solelog/shared';
import { apiFetch } from '../lib/api';
// The signed-in user (id, email, name). Used by the Account screen.
export function useMe() {
return useQuery({
queryKey: ['me'],
queryFn: () => apiFetch<MeResponse>('/api/me'),
});
}