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:
parent
064b2da5a4
commit
e692e7b19e
|
@ -28,7 +28,8 @@ function request(type, path, params = {}) {
|
||||||
'X-Embark-Request-Hash': requestHash,
|
'X-Embark-Request-Hash': requestHash,
|
||||||
'X-Embark-Cnonce': cnonce
|
'X-Embark-Cnonce': cnonce
|
||||||
},
|
},
|
||||||
data: params
|
...(type === 'post' ? { data: params } : {}),
|
||||||
|
...(type === 'get' ? { params } : {})
|
||||||
}
|
}
|
||||||
|
|
||||||
return axios(req)
|
return axios(req)
|
||||||
|
|
Loading…
Reference in New Issue