Add proactive token refresh when getAccessToken() returns null, plus
401 retry logic. The in-memory token can be null if it expired between
page load and upload attempt.
Co-Authored-By: Claude <noreply@anthropic.com>
- Add uploadFile function to commonApi with Authorization header
- Replace raw fetch with commonApi.uploadFile in ImageUploader
Co-Authored-By: Claude <noreply@anthropic.com>
Frontend was sending `type` and `target_id` but backend expects
`resource_type` and `resource_id`, causing 40000 validation error.
Co-Authored-By: Claude <noreply@anthropic.com>
WHY: migrating from Supabase BaaS to self-hosted iloom backend
(Go microservices) deployed on K3s. Supabase client and realtime
subscriptions no longer applicable.
HOW:
- add src/api/ layer (client.ts, auth.ts, purchaser.ts, textile.ts,
washing.ts, websocket.ts) targeting iloom-gateway REST endpoints
- rewrite all hooks (usePlanData, useInventoryData, useDashboardData,
useRealtime, etc.) to use new API client instead of Supabase queries
- rewrite all page/component data fetching and mutations accordingly
- delete src/supabase/client.ts, remove @supabase/supabase-js dep
- add Dockerfile (multi-stage node build + nginx) and nginx.conf
with reverse proxy to iloom-gateway for /api/ and /ws/ routes
- adjust webpack.config.js for API_URL environment variable injection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>