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
Summary
The
GET /api/admin/errors/:idandPATCH /api/admin/errors/:idhandlers inserver/api/src/routes/admin/errors.tscurrently return success payloads using the keyerror(e.g.,{ error: row }), which is misleading sinceerrorconventionally 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
GET /:idandPATCH /:id) fromerrorto a more descriptive name such asdataorapiError.admin/src/api/admin.tsin the same PR.server/api/src/__tests__/routes/admin/errors.test.tsandadmin/src/api/admin.test.tsare updated accordingly.References