diff --git a/src/utils/Fetcher.jsx b/src/utils/Fetcher.jsx index 7313f58..ba17597 100644 --- a/src/utils/Fetcher.jsx +++ b/src/utils/Fetcher.jsx @@ -123,12 +123,12 @@ const MarkChoreComplete = (id, body, completedDate, performer) => { }) } -const CompleteSubTask = (id, choreId, completedAt) => { +const CompleteSubTask = (id, choreId, performedAt) => { var markChoreURL = `/chores/${choreId}/subtask` return Fetch(markChoreURL, { method: 'PUT', headers: HEADERS(), - body: JSON.stringify({ completedAt, id, choreId }), + body: JSON.stringify({ performedAt, id, choreId }), }) } diff --git a/src/views/ChoreEdit/RepeatSection.jsx b/src/views/ChoreEdit/RepeatSection.jsx index 0b00abc..60efcc4 100644 --- a/src/views/ChoreEdit/RepeatSection.jsx +++ b/src/views/ChoreEdit/RepeatSection.jsx @@ -17,7 +17,7 @@ import { Typography, } from '@mui/joy' import moment from 'moment' -import { useContext, useState } from 'react' +import { useContext, useEffect, useState } from 'react' import { UserContext } from '../../contexts/UserContext' import { isPlusAccount } from '../../utils/Helpers' import ThingTriggerSection from './ThingTriggerSection' @@ -71,6 +71,16 @@ const RepeatOnSections = ({ things, }) => { const [intervalUnit, setIntervalUnit] = useState('days') + // if time on frequencyMetadata is not set, try to set it to the nextDueDate if available, + // otherwise set it to 18:00 of the current day + useEffect(() => { + if (!frequencyMetadata?.time) { + frequencyMetadata.time = moment( + moment(new Date()).format('YYYY-MM-DD') + 'T' + '18:00', + ).format() + } + }, []) + const timePickerComponent = ( At: diff --git a/src/views/Chores/Sidepanel.jsx b/src/views/Chores/Sidepanel.jsx index f9a5d0b..1bf0a82 100644 --- a/src/views/Chores/Sidepanel.jsx +++ b/src/views/Chores/Sidepanel.jsx @@ -40,10 +40,10 @@ const Sidepanel = ({ chores }) => { return ( - { justifyContent: 'space-between', boxShadow: 'sm', borderRadius: 20, - height: '80vh', width: '315px', }} > - + + ) } diff --git a/src/views/Chores/WelcomeCard.jsx b/src/views/Chores/WelcomeCard.jsx index 54baff3..d527f81 100644 --- a/src/views/Chores/WelcomeCard.jsx +++ b/src/views/Chores/WelcomeCard.jsx @@ -62,7 +62,7 @@ const WelcomeCard = () => { gap: 1, }} > - + Current User @@ -105,7 +105,7 @@ const WelcomeCard = () => { justifyContent: 'space-between', boxShadow: 'sm', borderRadius: 20, - width: '290px', + width: '310px', mb: 1, }} > @@ -127,7 +127,7 @@ const WelcomeCard = () => { gap: 1, }} > - + Current User