Skip to content

Commit b0edd2e

Browse files
authored
Update committee.js
1 parent 5a7719c commit b0edd2e

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

src/pages/committee.js

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,25 +95,30 @@ export default function Committee({ committeeData = {} }) {
9595
// -----------------------------
9696
// Data fetching
9797
// -----------------------------
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-
}
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+
useEffect(() => {
118+
fetch("https://wrcrobotics.pythonanywhere.com/committee")
119+
.then(res => res.json())
120+
.then(setData);
121+
}, []);
117122

118123
// -----------------------------
119124
// Styles (cleaned)

0 commit comments

Comments
 (0)