Add Support for LabelV2, Add LabelModal and LabelView.
Add React Query
This commit is contained in:
parent
5e590bfe9f
commit
42182371ff
18 changed files with 839 additions and 71 deletions
17
src/queries/ChoreQueries.jsx
Normal file
17
src/queries/ChoreQueries.jsx
Normal 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')
|
||||
},
|
||||
})
|
||||
}
|
6
src/queries/UserQueries.jsx
Normal file
6
src/queries/UserQueries.jsx
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { useQuery } from 'react-query'
|
||||
import { GetAllUsers } from '../utils/Fetcher'
|
||||
|
||||
export const useAllUsers = () => {
|
||||
return useQuery('allUsers', GetAllUsers)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue