diff --git a/src/utils/Fetcher.jsx b/src/utils/Fetcher.jsx index 655a15b..2b5710b 100644 --- a/src/utils/Fetcher.jsx +++ b/src/utils/Fetcher.jsx @@ -11,7 +11,8 @@ const createChore = userID => { } const signUp = (username, password, displayName, email) => { - return fetch(`/auth/`, { + const baseURL = apiManager.getApiURL() + return fetch(`${baseURL}/auth/`, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -420,11 +421,16 @@ const RefreshToken = () => { headers: HEADERS(), }) } -const GetChoresHistory = async limit => { +const GetChoresHistory = async (limit, includeMembers) => { var url = `/chores/history` + if (!limit) limit = 7 + if (limit) { url += `?limit=${limit}` } + if (includeMembers) { + url += `&members=true` + } const resp = await Fetch(url, { method: 'GET', headers: HEADERS(),