File tree Expand file tree Collapse file tree 1 file changed +3
-41
lines changed Expand file tree Collapse file tree 1 file changed +3
-41
lines changed Original file line number Diff line number Diff line change @@ -8,47 +8,9 @@ import ScheduleList, {
8
8
ScheduleSession ,
9
9
} from "../components/Conf/Schedule/ScheduleList"
10
10
11
- const fetchData = async ( url : string ) => {
12
- try {
13
- const response = await fetch ( url , {
14
- method : "POST" ,
15
- headers : {
16
- "Content-Type" : "application/json" ,
17
- "User-Agent" : "GraphQL Conf / GraphQL Foundation" ,
18
- } ,
19
- } )
20
- const data = await response . json ( )
21
- return data
22
- } catch ( error : any ) {
23
- throw new Error (
24
- `Error fetching data from ${ url } : ${ error . message || error . toString ( ) } `
25
- )
26
- }
27
- }
28
-
29
- export async function getServerData ( ) {
30
- try {
31
- const schedule : ScheduleSession [ ] = await fetchData (
32
- `https://graphqlconf23.sched.com/api/session/list?api_key=${ process . env . SCHED_ACCESS_TOKEN } &format=json`
33
- )
34
-
35
- return {
36
- props : {
37
- schedule,
38
- } ,
39
- }
40
- } catch ( error ) {
41
- return {
42
- status : 500 ,
43
- headers : { } ,
44
- props : { } ,
45
- }
46
- }
47
- }
48
-
49
- const ScheduleTemplate : FC <
50
- PageProps < { } , { } , { } , { schedule : ScheduleSession [ ] } >
51
- > = ( { serverData : { schedule } } ) => {
11
+ const ScheduleTemplate : FC < PageProps < { } , { schedule : ScheduleSession [ ] } > > = ( {
12
+ pageContext : { schedule } ,
13
+ } ) => {
52
14
return (
53
15
< LayoutConf >
54
16
< HeaderConf className = "shadow-none" />
You can’t perform that action at this time.
0 commit comments