From cf2c2d8a4eb63e76ecb916fda608b6c39d0d47ca Mon Sep 17 00:00:00 2001 From: Yarin Dekel Date: Tue, 16 Oct 2018 12:11:13 +0300 Subject: fix rest API header UI Issue-ID: SDC-1838 Change-Id: Idc02f6df489c8237a6b1c34d18ef3d2d0819f3b6 Signed-off-by: Yarin Dekel --- .../src/main/frontend/src/services/restAPIUtil.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'workflow-designer-ui') diff --git a/workflow-designer-ui/src/main/frontend/src/services/restAPIUtil.js b/workflow-designer-ui/src/main/frontend/src/services/restAPIUtil.js index d5c0f9b0..05c0d799 100644 --- a/workflow-designer-ui/src/main/frontend/src/services/restAPIUtil.js +++ b/workflow-designer-ui/src/main/frontend/src/services/restAPIUtil.js @@ -34,11 +34,6 @@ const POST = 'POST'; const PUT = 'PUT'; const DELETE = 'DELETE'; const PATCH = 'PATCH'; - -// content-types -const APPLICATION_JSON = 'application/json'; -const MULTIPART_FORM_DATA = 'multipart/form-data'; - const BINARY = 'binary'; const AUTHORIZATION_HEADER = 'X-AUTH-TOKEN'; @@ -89,19 +84,9 @@ function handleSuccess(responseHeaders, requestHeaders) { } class RestAPIUtil { - async handleRequest(url, type, options = {}, data) { + async handleRequest(url, type, options = {}, data = {}) { applySecurity(options, data); - // TODO see ig necessary or in transformrequest funtion - if (type === POST || type === PUT || type === PATCH) { - options.headers.contentType = - data instanceof FormData - ? MULTIPART_FORM_DATA - : APPLICATION_JSON; - } else { - data = null; - } - let config = { method: type, url: url, -- cgit 1.2.3-korg