Merge branch 'dev'
This commit is contained in:
commit
76ed927839
2 changed files with 4 additions and 5 deletions
|
@ -179,9 +179,9 @@ export const notInCompletionWindow = chore => {
|
||||||
export const ChoreFilters = userProfile => ({
|
export const ChoreFilters = userProfile => ({
|
||||||
anyone: () => true,
|
anyone: () => true,
|
||||||
assigned_to_me: chore => {
|
assigned_to_me: chore => {
|
||||||
return chore.assignedTo && chore.assignedTo === userProfile.id
|
return chore.assignedTo && chore.assignedTo === userProfile?.id
|
||||||
},
|
},
|
||||||
assigned_to_others: chore => {
|
assigned_to_others: chore => {
|
||||||
return chore.assignedTo && chore.assignedTo !== userProfile.id
|
return chore.assignedTo && chore.assignedTo !== userProfile?.id
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
@ -98,13 +98,12 @@ const MyChores = () => {
|
||||||
throw new Error(userProfileResponse.statusText)
|
throw new Error(userProfileResponse.statusText)
|
||||||
}
|
}
|
||||||
Promise.all([
|
Promise.all([
|
||||||
|
userProfileResponse.json(),
|
||||||
choresResponse.json(),
|
choresResponse.json(),
|
||||||
usersResponse.json(),
|
usersResponse.json(),
|
||||||
userProfileResponse.json(),
|
|
||||||
]).then(data => {
|
]).then(data => {
|
||||||
const [choresData, usersData, userProfileData] = data
|
const [userProfileData, choresData, usersData] = data
|
||||||
setUserProfile(userProfileData.res)
|
setUserProfile(userProfileData.res)
|
||||||
choresData.res.sort(ChoreSorter)
|
|
||||||
setChores(choresData.res)
|
setChores(choresData.res)
|
||||||
setFilteredChores(choresData.res)
|
setFilteredChores(choresData.res)
|
||||||
setPerformers(usersData.res)
|
setPerformers(usersData.res)
|
||||||
|
|
Loading…
Add table
Reference in a new issue