From a8d68b0b1f01862cd2fb12b4f25ab309eb286ef0 Mon Sep 17 00:00:00 2001 From: Rhys Mills Date: Mon, 25 Nov 2024 11:26:03 +0000 Subject: [PATCH] Ensure POST requests to workflow still wor --- public/video-ui/src/services/WorkflowApi.js | 1 - public/video-ui/src/services/pandaReqwest.js | 10 ++++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/public/video-ui/src/services/WorkflowApi.js b/public/video-ui/src/services/WorkflowApi.js index 7f71f33b2..28b7399ad 100644 --- a/public/video-ui/src/services/WorkflowApi.js +++ b/public/video-ui/src/services/WorkflowApi.js @@ -148,7 +148,6 @@ export default class WorkflowApi { prodOffice, priority }); - return pandaReqwest({ method: 'POST', url: `${WorkflowApi.workflowUrl}/api/stubs`, diff --git a/public/video-ui/src/services/pandaReqwest.js b/public/video-ui/src/services/pandaReqwest.js index 299ec4678..d0af2b64e 100644 --- a/public/video-ui/src/services/pandaReqwest.js +++ b/public/video-ui/src/services/pandaReqwest.js @@ -56,8 +56,14 @@ export const pandaReqwest = (reqwestBody, timeout = 0) => { // prettier-ignore if (payload.contentType === 'application/json' && typeof payload.data === 'object') { - - payload.data = JSON.stringify(payload.data); + if (payload.headers){ + payload.headers["Content-Type"] = "application/json"; + } else { + payload.headers ={ + "Content-Type": "application/json" + }; + } + payload.body = JSON.stringify(payload.data); } }