feat(admin): add bulk management actions#6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 973f7d5e35
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| method: 'DELETE', | ||
| data: { ids: selectedRows.map((item) => item.id) }, | ||
| skipErrorHandler: true, |
There was a problem hiding this comment.
Send question batch IDs with a supported payload method
This call relies on method: 'DELETE' with data, but the @umijs/max request client is backed by umi-request semantics where data is only serialized for PUT/POST/PATCH (and apps/admin/src/request.ts does not override that behavior). In practice, the /api/admin/questions/batch request can be sent without the ids body, so the new bulk delete action fails with backend validation (invalid request/ids are required) instead of deleting selected questions.
Useful? React with 👍 / 👎.
| method: 'DELETE', | ||
| data: { ids: selectedRows.map((item) => item.id) }, | ||
| skipErrorHandler: true, |
There was a problem hiding this comment.
Send paper batch IDs with a supported payload method
This bulk-delete request uses the same DELETE + data pattern, which is not serialized by umi-request defaults (only PUT/POST/PATCH carry data bodies, and no custom override is configured in apps/admin/src/request.ts). As a result, /api/admin/papers/batch can receive an empty body and reject the operation, so the new batch paper delete flow is functionally broken from the admin UI.
Useful? React with 👍 / 👎.
Summary
Validation
git diff --checkpnpm --dir apps/admin biomepnpm --dir apps/admin lintpnpm --dir apps/desktop biomepnpm --dir apps/desktop typecheckpnpm --dir apps/desktop buildgo test ./...