From e692e7b19ea93b43d86cf54fa2f7ae866e646d23 Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Thu, 18 Oct 2018 18:39:30 +0200 Subject: [PATCH] fix(cockpit/sevices/api): properly send query parameters for get requests Ever since we moved to using Axios in https://github.com/status-im/embark-area-51/commit/20831179fc116bb56224486844e20a172a2eafc9, we haven't properly sent GET parameters along with the requests. This is because Axios exposes two different properties to send params along different http verb methods. --- embark-ui/src/services/api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embark-ui/src/services/api.js b/embark-ui/src/services/api.js index 2431811b..50fab190 100644 --- a/embark-ui/src/services/api.js +++ b/embark-ui/src/services/api.js @@ -28,7 +28,8 @@ function request(type, path, params = {}) { 'X-Embark-Request-Hash': requestHash, 'X-Embark-Cnonce': cnonce }, - data: params + ...(type === 'post' ? { data: params } : {}), + ...(type === 'get' ? { params } : {}) } return axios(req)