12 Commits

Author SHA1 Message Date
Chever John
c641831251
fix: handle plans API returning array instead of {plans:[]} object
The purchaser plans endpoint returns data as a plain array, not wrapped
in {plans:[...]}. Added Array.isArray check to handle both formats.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-30 02:07:18 +08:00
Chever John
69543a8aef
fix: handle null API response data to prevent infinite loading
When API returns {"data": null} for empty lists, accessing .plans on
null throws an exception. fetchPlans never reaches setLoading(false),
causing the dashboard to spin forever. Added optional chaining,
fallback defaults, and try-catch-finally to ensure loading stops.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-30 02:00:04 +08:00
Chever John
6b866738be
fix: stop infinite loading spinner when user has no company
Dashboard pages hung on "加载仪表盘数据..." when auth.company was null
(e.g. admin user). Now sets loading=false immediately when no company
is present, so the page renders instead of spinning forever.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-30 01:31:25 +08:00
Chever John
9ecf3c3179
fix: pass refresh_token in body when calling /auth/refresh
The refresh endpoint expects {"refresh_token":"..."} in the POST body,
but the frontend was sending an empty body (EOF error). Now stores the
refresh_token from login response and sends it on refresh requests.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-30 01:28:45 +08:00
Chever John
b1c2c33aa2
refactor: replace Supabase SDK with self-hosted REST API client layer
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>
2026-06-14 12:38:47 +08:00
github-actions[bot]
d06690963c sync: Add files via upload (A@f3f0916866583911d315136c8b16f45e6a96c236) 2026-06-04 15:56:19 +00:00
github-actions[bot]
e604317c7f sync: Add files via upload (A@90dbd4d185c93e599be85a4cb190f35d45c1495f) 2026-06-04 15:09:31 +00:00
github-actions[bot]
b6e2e526d9 sync: Add files via upload
重大版本更新 (A@029ab8fcd9c4f587ce7a2394252868172d8e5d79)
2026-06-04 13:57:36 +00:00
github-actions[bot]
e713fcbf18 sync: Add files via upload (A@e5347bf93cdb38c0fdf86271231c0e884465195a) 2026-05-28 06:28:50 +00:00
github-actions[bot]
3f7377b142 sync: Add files via upload (A@87b0a27431d8596edf55a7e623f944ca2f39f234) 2026-05-28 05:54:23 +00:00
github-actions[bot]
37ecf1a056 sync: Add files via upload (A@f25beaaf2f1fcd0c8fca85fa622d846392968047) 2026-05-27 03:17:46 +00:00
github-actions[bot]
6517a3f4cd sync: update auto sync (A@67794d69b70f7d291333020c5ffd071a7836d177) 2026-05-26 05:15:10 +00:00