Add Points view, Don't allow completion outside the completion window, migrate more things to react query

This commit is contained in:
Mo Tarbin 2024-12-31 02:20:52 -05:00
parent d98f4b599f
commit 32583b1a9e
13 changed files with 619 additions and 27 deletions

View file

@ -1,3 +1,4 @@
import moment from 'moment'
import { TASK_COLOR } from './Colors.jsx'
export const ChoresGrouper = (groupBy, chores) => {
@ -158,3 +159,12 @@ export const ChoresGrouper = (groupBy, chores) => {
}
return groups
}
export const notInCompletionWindow = chore => {
return (
chore.completionWindow &&
chore.completionWindow > -1 &&
chore.nextDueDate &&
moment().add(chore.completionWindow, 'hours') < moment(chore.nextDueDate)
)
}

View file

@ -194,11 +194,12 @@ const UpdateChoreHistory = (choreId, id, choreHistory) => {
})
}
const GetAllCircleMembers = () => {
return Fetch(`/circles/members`, {
const GetAllCircleMembers = async () => {
const resp = await Fetch(`/circles/members`, {
method: 'GET',
headers: HEADERS(),
})
return resp.json()
}
const GetUserProfile = () => {