generated from xgeekshq/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE]: add get team endpoint (#592)
* fix: fix returned information and attribute name * fix: remove link to boards page/change blob color * fix: fix members list layout * feat: add animation to tooltip * feat: add getTeam query as hook * fix: resolve requested changes
- Loading branch information
1 parent
a22c24e
commit 9c37ca3
Showing
12 changed files
with
147 additions
and
58 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
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 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 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 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 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 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 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 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 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,40 @@ | ||
import { QueryClient, useQueryClient } from 'react-query'; | ||
import { NextRouter, useRouter } from 'next/router'; | ||
import { useSession } from 'next-auth/react'; | ||
import { SetterOrUpdater, useSetRecoilState } from 'recoil'; | ||
|
||
import { toastState } from 'store/toast/atom/toast.atom'; | ||
import { ToastStateEnum } from '../utils/enums/toast-types'; | ||
|
||
type TeamUtilsType = { | ||
userId: string; | ||
teamId: string | string[] | undefined; | ||
queryClient: QueryClient; | ||
setToastState: SetterOrUpdater<{ open: boolean; type: ToastStateEnum; content: string }>; | ||
router: NextRouter; | ||
}; | ||
|
||
const useTeamUtils = (): TeamUtilsType => { | ||
const router = useRouter(); | ||
const { data: session } = useSession({ required: false }); | ||
|
||
const queryClient = useQueryClient(); | ||
|
||
let userId = ''; | ||
|
||
if (session) userId = session.user.id; | ||
|
||
const setToastState = useSetRecoilState(toastState); | ||
|
||
const { teamId } = router.query; | ||
|
||
return { | ||
userId, | ||
teamId, | ||
queryClient, | ||
setToastState, | ||
router | ||
}; | ||
}; | ||
|
||
export default useTeamUtils; |
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 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