Skip to content

Rename success response key from 'error' to 'data' in admin errors API endpoints #909

@coderabbitai

Description

@coderabbitai

Summary

The GET /api/admin/errors/:id and PATCH /api/admin/errors/:id handlers in server/api/src/routes/admin/errors.ts currently return success payloads using the key error (e.g., { error: row }), which is misleading since error conventionally indicates an error message.

This was intentionally deferred from PR #905 (comment: #905 (comment)) because the admin client (admin/src/api/admin.ts) is already typed against the { error: ApiErrorRow } shape.

Acceptance Criteria

  • Rename the success response key in both handlers (GET /:id and PATCH /:id) from error to a more descriptive name such as data or apiError.
  • Update the corresponding admin client types and fetch functions in admin/src/api/admin.ts in the same PR.
  • Ensure tests in server/api/src/__tests__/routes/admin/errors.test.ts and admin/src/api/admin.test.ts are updated accordingly.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions