Add Support for LabelV2, Add LabelModal and LabelView.

Add React Query
This commit is contained in:
Mo Tarbin 2024-11-23 20:23:59 -05:00
parent 5e590bfe9f
commit 42182371ff
18 changed files with 839 additions and 71 deletions

View file

@ -0,0 +1,17 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { useQuery } from 'react-query'
import { CreateChore, GetChoresNew } from '../utils/Fetcher'
export const useChores = () => {
return useQuery('chores', GetChoresNew)
}
export const useCreateChore = () => {
const queryClient = useQueryClient()
return useMutation(CreateChore, {
onSuccess: () => {
queryClient.invalidateQueries('chores')
},
})
}

View file

@ -0,0 +1,6 @@
import { useQuery } from 'react-query'
import { GetAllUsers } from '../utils/Fetcher'
export const useAllUsers = () => {
return useQuery('allUsers', GetAllUsers)
}