fix(cockpit/sevices/api): properly send query parameters for get requests

Ever since we moved to using Axios in 20831179fc,
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.
This commit is contained in:
Pascal Precht 2018-10-18 18:39:30 +02:00
parent 064b2da5a4
commit e692e7b19e
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 2 additions and 1 deletions

View File

@ -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)