Skip to content

Commit 50cd6aa

Browse files
authored
Update committee.js
1 parent 33f9ff3 commit 50cd6aa

1 file changed

Lines changed: 22 additions & 4 deletions

File tree

src/pages/committee.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)