refactor(admin): migrate data layer to V2 API response contract#1045
Merged
Conversation
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
- posts/notes/drafts: switch list sort params to wire-format sort_by/sort_order (snake_case enums) to match server's createPagerSchema; previous camelCase + numeric -1/1 was rejected - manage-posts/notes list views: pass the new sort keys through - webhook create: always send `secret: ''` when the form leaves it blank; server's WebhookSchema requires `z.string()` and the admin form intentionally treats the field as optional - docs/superpowers: capture in-progress React migration specs (status, layout shell, data flow, datatable, list filter bar, recovery banner, rightpane quick edit) so they survive across machines
ef2dafd to
40c0434
Compare
…slation Admin always edits/manages original records; no admin endpoint consumes translated payloads. Send `x-skip-translation: 1` on every outbound request (shared $api instance plus the raw agent-chat SSE fetch) so the backend ignores browser-implicit Accept-Language and NEXT_LOCALE cookie. Explicit `?lang=xx` query and `x-lang` header remain respected for business filters (enrichment per-locale rows, search index).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Migrates the admin dashboard data layer to the mx-core V2 API response contract (success envelope
{ data, meta? }, error envelope{ error: { code, message, details? } }).Companion to the mx-core V2 API refactor (PR #2729) and the
@mx-space/api-clientV2 migration.Changes
utils/request.ts—transformResponseunwraps the{ data, meta? }envelope; liftsmeta.paginationto{ data, pagination }.onResponseErrorreadserror.message/error.codefrom the V2 error envelope.BusinessErrorgains an optionalcode.models/base.ts—Pagershape updated to{ page, size, total, totalPages }.models/enrichment.ts,models/search-index.ts— local legacy pager types kept; the enrichment-admin and search-admin endpoints still emit the legacy pagination shape.api/posts.ts,api/notes.ts,api/pages.ts— removed theselectquery param (V2 uses named views instead).selectcall-site removal across manage-notes, manage-posts, manage-pages, manage-says, manage-project, reader, AI selectors, and comments.Verification
tsctypecheck clean (except a pre-existing unrelated baseUrl warning).oxlint0 errors.