Fix #65 missing based url from sign up

Add Support for CircleMember History in GetChoresHistory
This commit is contained in:
Mo Tarbin 2024-12-30 13:35:22 -05:00
parent d4c36e2057
commit d98f4b599f

View file

@ -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(),