-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOP-22969] rewrite SelectedGroupProvider
- Loading branch information
Zabilsya
committed
Jan 17, 2025
1 parent
c0ff15b
commit ad5d2d4
Showing
6 changed files
with
32 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './useGetGroup'; | ||
export * from './useDeleteGroupUser'; | ||
export * from './useGetInitialGroup'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useQuery, UseQueryResult } from '@tanstack/react-query'; | ||
|
||
import { GetGroupRequest, Group } from '../../types'; | ||
import { GroupQueryKey } from '../../keys'; | ||
import { groupService } from '../../groupService'; | ||
|
||
/** Hook for getting group info from backend */ | ||
export const useGetInitialGroup = ({ id }: GetGroupRequest): UseQueryResult<Group> => { | ||
return useQuery({ | ||
queryKey: [GroupQueryKey.GET_GROUP, id], | ||
queryFn: () => groupService.getGroup({ id }), | ||
enabled: !!id, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 16 additions & 7 deletions
23
src/entities/group/providers/SelectedGroupProvider/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.