Skip to content

Commit a3ef409

Browse files
committed
키노트 목록 api endpoint 변경
1 parent 83e53e1 commit a3ef409

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

frontend/data/constants/resources.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Resources = {
2121
},
2222
pyconkrFacebook: 'https://www.facebook.com/pyconkorea',
2323
pyconkrTwitter: 'https://twitter.com/PyConKR',
24-
KEYNOTE_CATEGORY: '키노트 (Keynote)',
24+
KEYNOTE_CATEGORY: 13,
2525
FESTA_TICKET_LINK: 'https://festa.io/events/2605'
2626
}
2727

frontend/pages/api/program.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import axios from 'axios'
22
import { API_SERVER } from '../../data/constants/config'
33
import { ITalkItem, ITalkList } from '../../interfaces/IProgram'
44
import { IApiTalkItem } from '../../interfaces/api/IApiPrograms'
5+
import Resources from '../../data/constants/resources'
56

67
export const getTalkList = async (): Promise<ITalkList> => {
78
const response = await axios.get(`${API_SERVER}/program/list`)
@@ -20,3 +21,14 @@ export const getTalkById = async (id: string): Promise<ITalkItem> => {
2021
...data
2122
}
2223
}
24+
25+
export const getKeynoteList = async (): Promise<ITalkList> => {
26+
const response = await axios.get(
27+
`${API_SERVER}/program/category/${Resources.KEYNOTE_CATEGORY}`
28+
)
29+
const data: IApiTalkItem[] = response.data
30+
31+
return {
32+
list: data
33+
}
34+
}

frontend/pages/program/keynote.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PageName } from '../../data/enums/PageName'
55
import PageTitle from '../../components/core/PageTitle'
66
import { PageProps } from '../../interfaces/PageProps'
77
import { GetServerSidePropsContext } from 'next'
8-
import { getTalkList } from '../api/program'
8+
import { getKeynoteList, getTalkList } from '../api/program'
99
import { ITalkList } from '../../interfaces/IProgram'
1010
import KeynoteListItem from '../../components/service/Program/KeynoteListItem'
1111

@@ -16,13 +16,10 @@ interface TalkListProps extends PageProps {
1616
const Keynote: NextPage = (props: TalkListProps) => {
1717
const { pageName, data } = props
1818

19-
const keynoteList = data.list.filter(
20-
(item) => item.category === '키노트 (Keynote)'
21-
)
2219
return (
2320
<div>
2421
<PageTitle title={pageName} />
25-
{keynoteList.map((item) => (
22+
{data.list.map((item) => (
2623
<KeynoteListItem key={item.id} item={item} />
2724
))}
2825
</div>
@@ -34,7 +31,7 @@ export const getServerSideProps: GetServerSideProps = async (
3431
) => {
3532
const { locale } = context
3633
try {
37-
const data = await getTalkList()
34+
const data = await getKeynoteList()
3835

3936
return {
4037
props: {

0 commit comments

Comments
 (0)