setOpen(false)}
+ anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
+ sx={(theme) => ({
+ background: `linear-gradient(45deg, ${theme.palette.primary[600]} 30%, ${theme.palette.primary[500]} 90%})`,
+ maxWidth: 360,
+ })}
+ >
+
+ Need Notification?
+
+ You need to enable permission to receive notifications, do you want to enable it?
+
+
+
+
+
+
+
+
+)
+}
+
+export default NotificationAccessSnackbar;
\ No newline at end of file
diff --git a/src/views/ChoresOverview.jsx b/src/views/ChoresOverview.jsx
index 396ab0d..14b2040 100644
--- a/src/views/ChoresOverview.jsx
+++ b/src/views/ChoresOverview.jsx
@@ -27,7 +27,7 @@ import moment from 'moment'
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { API_URL } from '../Config'
-import { GetAllUsers } from '../utils/Fetcher'
+import { GetAllUsers, GetChores, MarkChoreComplete } from '../utils/Fetcher'
import { Fetch } from '../utils/TokenManager'
import DateModal from './Modals/Inputs/DateModal'
// import moment from 'moment'
@@ -98,7 +98,7 @@ const ChoresOverview = () => {
}
useEffect(() => {
// fetch chores:
- Fetch(`${API_URL}/chores/`)
+ GetChores()
.then(response => response.json())
.then(data => {
const filteredData = data.res.filter(
@@ -263,9 +263,8 @@ const ChoresOverview = () => {
size='sm'
// sx={{ borderRadius: '50%' }}
onClick={() => {
- Fetch(`${API_URL}/chores/${chore.id}/do`, {
- method: 'POST',
- }).then(response => {
+ MarkChoreComplete(chore.id,null,null,null)
+ .then(response => {
if (response.ok) {
response.json().then(data => {
const newChore = data.res
@@ -326,14 +325,8 @@ const ChoresOverview = () => {
alert('Please select a performer')
return
}
- fetch(
- `${API_URL}/chores/${choreId}/do?performer=${activeUserId}&completedDate=${new Date(
- date,
- ).toISOString()}`,
- {
- method: 'POST',
- },
- ).then(response => {
+ MarkChoreComplete(choreId, null, date, activeUserId)
+ .then(response => {
if (response.ok) {
response.json().then(data => {
const newChore = data.res
diff --git a/src/views/History/ChoreHistory.jsx b/src/views/History/ChoreHistory.jsx
index 9419f59..651e9d6 100644
--- a/src/views/History/ChoreHistory.jsx
+++ b/src/views/History/ChoreHistory.jsx
@@ -18,6 +18,7 @@ import { API_URL } from '../../Config'
import {
DeleteChoreHistory,
GetAllCircleMembers,
+ GetChoreHistory,
UpdateChoreHistory,
} from '../../utils/Fetcher'
import { Fetch } from '../../utils/TokenManager'
@@ -40,7 +41,7 @@ const ChoreHistory = () => {
setIsLoading(true) // Start loading
Promise.all([
- Fetch(`${API_URL}/chores/${choreId}/history`).then(res => res.json()),
+ GetChoreHistory(choreId).then(res => res.json()),
GetAllCircleMembers().then(res => res.json()),
])
.then(([historyData, usersData]) => {
diff --git a/src/views/History/HistoryCard.jsx b/src/views/History/HistoryCard.jsx
index 34a0b33..04e999c 100644
--- a/src/views/History/HistoryCard.jsx
+++ b/src/views/History/HistoryCard.jsx
@@ -11,6 +11,49 @@ import {
} from '@mui/joy'
import moment from 'moment'
+export const getCompletedChip = historyEntry => {
+ var text = 'No Due Date'
+ var color = 'info'
+ var icon =