Return response.data from axios

This commit is contained in:
Jerko Steiner 2019-01-20 00:48:13 +01:00
parent 26f106fcae
commit 4f17f8d6a9

View File

@ -27,12 +27,14 @@ export class HTTPClient<T extends IRoutes> implements IHTTPClient<T> {
return params.params![key] return params.params![key]
}) })
return this.axios.request({ const response = await this.axios.request({
method: params.method, method: params.method,
url, url,
params: params.query, params: params.query,
data: params.body, data: params.body,
}) })
return response.data
} }
get<P extends keyof T & string>( get<P extends keyof T & string>(