File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,22 +95,40 @@ export default function Committee({ committeeData = {} }) {
9595// -----------------------------
9696// Data fetching
9797// -----------------------------
98- export async function getStaticProps ( ) {
98+ // export async function getStaticProps() {
99+ // try {
100+ // const res = await fetch(
101+ // "https://wrcrobotics.pythonanywhere.com/committee"
102+ // );
103+
104+ // const committeeData = await res.json();
105+
106+ // return {
107+ // props: { committeeData },
108+ // revalidate: 10,
109+ // };
110+ // } catch (err) {
111+ // return {
112+ // props: { committeeData: {} },
113+ // revalidate: 10,
114+ // };
115+ // }
116+ // }
117+ export async function getServerSideProps ( ) {
99118 try {
100119 const res = await fetch (
101- "https://wrcrobotics.pythonanywhere.com/committee"
120+ "https://wrcrobotics.pythonanywhere.com/committee" ,
121+ { cache : "no-store" }
102122 ) ;
103123
104124 const committeeData = await res . json ( ) ;
105125
106126 return {
107127 props : { committeeData } ,
108- revalidate : 10 ,
109128 } ;
110129 } catch ( err ) {
111130 return {
112131 props : { committeeData : { } } ,
113- revalidate : 10 ,
114132 } ;
115133 }
116134}
You can’t perform that action at this time.
0 commit comments