Skip to content

Commit c1ff3db

Browse files
committed
fix: defaulting mountAt to undefined, to avoid a crash
1 parent 666c4fb commit c1ff3db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/api-client.js

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

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

5-
export function getRequest(url, params, { mountAt = global.qtMountAt || "" }) {
5+
export function getRequest(url, params, { mountAt = global.qtMountAt || "" } = {}) {
66
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, { mountAt = global.qtMountAt || "" }) {
12+
export function postRequest(url, body, { mountAt = global.qtMountAt || "" } = {}) {
1313
return apiClient
1414
.url(`${mountAt}${url}`)
1515
.post(body);

0 commit comments

Comments
 (0)