File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed
Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import axios from 'axios'
22import { API_SERVER } from '../../data/constants/config'
33import { ITalkItem , ITalkList } from '../../interfaces/IProgram'
44import { IApiTalkItem } from '../../interfaces/api/IApiPrograms'
5+ import Resources from '../../data/constants/resources'
56
67export 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+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { PageName } from '../../data/enums/PageName'
55import PageTitle from '../../components/core/PageTitle'
66import { PageProps } from '../../interfaces/PageProps'
77import { GetServerSidePropsContext } from 'next'
8- import { getTalkList } from '../api/program'
8+ import { getKeynoteList , getTalkList } from '../api/program'
99import { ITalkList } from '../../interfaces/IProgram'
1010import KeynoteListItem from '../../components/service/Program/KeynoteListItem'
1111
@@ -16,13 +16,10 @@ interface TalkListProps extends PageProps {
1616const 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 : {
You can’t perform that action at this time.
0 commit comments