From 605cda66078170128d0e4877a50240d51a8e469b Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 9 Jun 2023 22:57:56 -0400 Subject: [PATCH] Use json, not send Signed-off-by: josh --- plugins/nomad-backend/src/service/router.ts | 8 ++++++-- plugins/nomad/package.json | 1 + yarn.lock | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/nomad-backend/src/service/router.ts b/plugins/nomad-backend/src/service/router.ts index a1b820866c..086137e2d7 100644 --- a/plugins/nomad-backend/src/service/router.ts +++ b/plugins/nomad-backend/src/service/router.ts @@ -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; } diff --git a/plugins/nomad/package.json b/plugins/nomad/package.json index 86c15f3aaa..7501aabf31 100644 --- a/plugins/nomad/package.json +++ b/plugins/nomad/package.json @@ -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": { diff --git a/yarn.lock b/yarn.lock index cadfdfc9b9..3c9711367f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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: