Skip to content

Commit bdceb2e

Browse files
장아영장아영
authored andcommitted
[#141] ✨ create getTeamRecruitmentList query
1 parent 6026fcd commit bdceb2e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

queries/team/useTeamList.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { TeamListItem } from '@/types/api/team.types'
2+
import { useQuery } from '@tanstack/react-query'
3+
4+
import { GetTeamRecruitmentList } from '@/services/team'
5+
6+
export const useTeamRecruitmentList = () => {
7+
return useQuery<TeamListItem[], Error>({
8+
queryKey: ['teamList'],
9+
queryFn: async () => {
10+
const data = await GetTeamRecruitmentList()
11+
return data.result as TeamListItem[]
12+
},
13+
staleTime: 1000 * 60 * 5,
14+
})
15+
}
16+
17+

0 commit comments

Comments
 (0)