Skip to content

feat: api client support for dataset proposals#385

Open
Scr4tch587 wants to merge 3 commits into
kai/dataset-proposalsfrom
kai/proposal-api-client
Open

feat: api client support for dataset proposals#385
Scr4tch587 wants to merge 3 commits into
kai/dataset-proposalsfrom
kai/proposal-api-client

Conversation

@Scr4tch587

Copy link
Copy Markdown
Collaborator

What changed

  • `lib/api.ts`: `apiFetch` gains an options object (method, JSON body, ok-statuses) and now extracts the backend's `detail` message from error bodies, so `ApiError.message` carries the server's actual validation error instead of a generic status line
  • new `proposeDataset()` + typed `DatasetProposalPayload` / `ProposalResponse` for `POST /api/v1/datasets`
  • `main.tsx`: the QueryClient's 401 handling (toast + reopen key dialog) now also covers mutations via a `MutationCache`, sharing one `handleAuthError`

Why

The create-dataset form (next PR) submits proposals and must surface the backend's precise 400/409 messages ("granularity is finer than dependency ...") inline in the form.

Benefit

Client layer for the proposal flow with no UI yet — small, independently reviewable. Existing fetch call sites are updated to the new signature with identical behavior.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant