From d98f4b599f436b49f80dff3efd3b854691775947 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Mon, 30 Dec 2024 13:35:22 -0500 Subject: [PATCH] Fix #65 missing based url from sign up Add Support for CircleMember History in GetChoresHistory --- src/utils/Fetcher.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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(),