You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue [Bug] Use sendResponse wrapper in deleteUserController for consistent API envelope
Tier: 🟢 Easy
Description:
Problem: The deleteUserController in src/modules/users/users.controller.ts line 22 uses raw res.json() to send the response instead of the standardized sendResponse() utility. This breaks the API contract — all other endpoints return the { success, message, data, meta } envelope, but user deletion returns a bare JSON object. The frontend's Axios interceptor expects the standard envelope and will fail to extract the response correctly.
Implementation: Replace res.json(...) with sendResponse(res, 200, true, 'User deleted successfully', result) (or appropriate message). Ensure the import for sendResponse is present at the top of the file.
Dependencies:
Depends on None
Acceptance Criteria:
deleteUserController uses sendResponse() instead of res.json().
Response follows the { success, message, data } envelope format.
Frontend can parse the delete response using the standard interceptor.
Proper HTTP status codes and our standard JSON response wrapper are used.
Edge cases (e.g., missing data, unauthorized roles) are handled gracefully.
Domain: Identity
Issue [Bug] Use
sendResponsewrapper indeleteUserControllerfor consistent API envelopeTier: 🟢 Easy
Description:
deleteUserControllerinsrc/modules/users/users.controller.tsline 22 uses rawres.json()to send the response instead of the standardizedsendResponse()utility. This breaks the API contract — all other endpoints return the{ success, message, data, meta }envelope, but user deletion returns a bare JSON object. The frontend's Axios interceptor expects the standard envelope and will fail to extract the response correctly.res.json(...)withsendResponse(res, 200, true, 'User deleted successfully', result)(or appropriate message). Ensure the import forsendResponseis present at the top of the file.Dependencies:
Acceptance Criteria:
deleteUserControllerusessendResponse()instead ofres.json().{ success, message, data }envelope format.Testing Requirements:
DELETE /users/:idresponse matches{ success: true, message: string, data: ... }shape.PR Checklist:
fix/issue-55-delete-user-response-envelope).npm run lintandnpm run buildpass with zero warnings.