fix: spread response data instead of nesting under 'data' key

The Phase 2.1 refactor wrapped success() responses as { success, data: {...} }
but the frontend expects flat responses like { success, license: {...} }.
This caused license to show FREE TIER and broke other API consumers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-01 02:00:05 -07:00
parent 9e24f33465
commit b60e7e40d0

View File

@@ -9,7 +9,7 @@ const { HTTP_STATUS } = require('./constants');
function success(res, data, statusCode = HTTP_STATUS.OK) { function success(res, data, statusCode = HTTP_STATUS.OK) {
return res.status(statusCode).json({ return res.status(statusCode).json({
success: true, success: true,
data ...data
}); });
} }
@@ -29,7 +29,7 @@ function successMessage(res, message, statusCode = HTTP_STATUS.OK) {
function created(res, data) { function created(res, data) {
return res.status(HTTP_STATUS.CREATED).json({ return res.status(HTTP_STATUS.CREATED).json({
success: true, success: true,
data ...data
}); });
} }