Use json, not send

Signed-off-by: josh <josh.timmons@hashicorp.com>
This commit is contained in:
josh
2023-06-09 22:57:56 -04:00
parent 7a995cf402
commit 605cda6607
3 changed files with 8 additions and 2 deletions
+6 -2
View File
@@ -70,7 +70,9 @@ export async function createRouter(
if (allocationsResp.status !== 200) {
const body = await allocationsResp.text();
logger.error(`failed to call /v1/allocations endpoint: ${body}`);
res.status(allocationsResp.status).send(body);
res.status(allocationsResp.status).json({
message: body,
});
return;
}
@@ -110,7 +112,9 @@ export async function createRouter(
if (apiResp.status !== 200) {
const body = await apiResp.text();
logger.error(`failed to call /v1/job/:job_id/versions endpoint: ${body}`);
resp.status(apiResp.status).send(body);
resp.status(apiResp.status).send({
message: body,
});
return;
}
+1
View File
@@ -31,6 +31,7 @@
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.60",
"luxon": "^3.3.0",
"react-use": "^17.2.4"
},
"peerDependencies": {
+1
View File
@@ -7969,6 +7969,7 @@ __metadata:
"@testing-library/user-event": ^14.0.0
"@types/node": "*"
cross-fetch: ^3.1.5
luxon: ^3.3.0
msw: ^1.0.0
react-use: ^17.2.4
peerDependencies: