Skip to content

Commit 9a257bc

Browse files
장아영장아영
authored andcommitted
[#141] ✅ test getTeamRecruitment query
1 parent bdceb2e commit 9a257bc

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/app/(pages)/test-page/page.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// }
2+
'use client'
3+
4+
import { useEffect, useState } from 'react'
5+
6+
import { TeamListItem } from '@/types/api/team.types'
7+
import { useTeamRecruitmentList } from 'queries/team/useTeamList'
8+
9+
10+
// }
11+
12+
// }
13+
14+
// }
15+
16+
export default function Page(): JSX.Element {
17+
const { data: teamList, isLoading, error } = useTeamRecruitmentList()
18+
if (isLoading) {
19+
return <p>Loading...</p>
20+
}
21+
22+
if (error) {
23+
return <p>{error.message}</p>
24+
}
25+
26+
return (
27+
<div>
28+
<ul>
29+
{teamList?.map((team: TeamListItem) => (
30+
<li key={team.id}>
31+
<h2>{team.teamTitle}</h2>
32+
<p>{team.teamContent}</p>
33+
<h3>{team.teamIsActive}</h3>
34+
<h3>{team.member.nickname}</h3>
35+
</li>
36+
))}
37+
</ul>
38+
</div>
39+
)
40+
}

0 commit comments

Comments
 (0)