Commit Graph

4 Commits

Author SHA1 Message Date
bvandeusen 7a6aa50693 feat(web): auto-logout on 401 inside apiFetch
Dynamic import breaks the apiFetch <-> auth/store cycle. silent:true
prevents re-POSTing /logout against an already-dead session.
2026-04-22 17:29:36 -04:00
bvandeusen 8a6a496c67 fix(web): drop invalid type-arg on toMatchObject in client tests
vitest's toMatchObject doesn't accept a type parameter; tests passed
under vitest (esbuild transpile) but svelte-check rejected. Plan-spec
bug introduced in 4d1a7f8; fixing here so check is clean before Task 6.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 17:26:15 -04:00
bvandeusen 37e5539e5a feat(web): add api.{get,post,del} typed facade over apiFetch 2026-04-22 16:04:25 -04:00
bvandeusen 4d1a7f8b93 feat(web): add apiFetch with typed error envelope
Wraps fetch, parses JSON, and throws ApiError{code,message,status}
on non-2xx. Degrades to {code:'unknown'} when the error body is not
the expected envelope shape.
2026-04-22 15:56:15 -04:00