Skip to content

fix: replace stale /submissions?contributor= endpoint with GET /api/v1/me/submissions (Closes #387) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #525

Open
waterWang wants to merge 2 commits into
BountyOnChain:mainfrom
waterWang:fix/dashboard-404-387
Open

fix: replace stale /submissions?contributor= endpoint with GET /api/v1/me/submissions (Closes #387) [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]#525
waterWang wants to merge 2 commits into
BountyOnChain:mainfrom
waterWang:fix/dashboard-404-387

Conversation

@waterWang

Copy link
Copy Markdown

What this fixes

The dashboard's /submissions?contributor= fetch was hitting a 404 because the backend has no /submissions route.

Changes

  • Removed stale API_URL constant
  • Added useAuth hook for auth token + API URL
  • Replaced GET /submissions?contributor= with GET /api/v1/me/submissions (see feat(backend): add PostgreSQL persistence with TypeORM #38)
  • Added Authorization: Bearer <token> header
  • Added response normalization (handles { submissions: [...] } vs plain array)
  • Updated useEffect dependency array

Closes #387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[S-B] Fix dashboard's fetch('/submissions?contributor=') 404

1 participant