We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd32155 commit 158266dCopy full SHA for 158266d
src/components/api-client.js
@@ -2,15 +2,15 @@ import wretch from 'wretch';
2
3
const apiClient = wretch().options({credentials: 'same-origin'});
4
5
-export function getRequest(url, params) {
6
- let client = apiClient.url(url);
+export function getRequest(url, params, { mountAt = global.qtMountAt || "" }) {
+ let client = apiClient.url(`${mountAt}${url}`);
7
if(params)
8
client = client.query(params);
9
return client.get();
10
}
11
12
-export function postRequest(url, body) {
+export function postRequest(url, body, { mountAt = global.qtMountAt || "" }) {
13
return apiClient
14
- .url(url)
+ .url(`${mountAt}${url}`)
15
.post(body);
16
-}
+}
0 commit comments