Skip to content

Commit 158266d

Browse files
committed
fix(Subdirectory): api-client honors the mount point
1 parent fd32155 commit 158266d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/api-client.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import wretch from 'wretch';
22

33
const apiClient = wretch().options({credentials: 'same-origin'});
44

5-
export function getRequest(url, params) {
6-
let client = apiClient.url(url);
5+
export function getRequest(url, params, { mountAt = global.qtMountAt || "" }) {
6+
let client = apiClient.url(`${mountAt}${url}`);
77
if(params)
88
client = client.query(params);
99
return client.get();
1010
}
1111

12-
export function postRequest(url, body) {
12+
export function postRequest(url, body, { mountAt = global.qtMountAt || "" }) {
1313
return apiClient
14-
.url(url)
14+
.url(`${mountAt}${url}`)
1515
.post(body);
16-
}
16+
}

0 commit comments

Comments
 (0)