MCPcopy Create free account
hub / github.com/amigoscode/spring-boot-fullstack-professional / fetchStudents

Function fetchStudents

src/frontend/src/App.js:118–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116 const [showDrawer, setShowDrawer] = useState(false);
117
118 const fetchStudents = () =>
119 getAllStudents()
120 .then(res => res.json())
121 .then(data => {
122 console.log(data);
123 setStudents(data);
124 }).catch(err => {
125 console.log(err.response)
126 err.response.json().then(res => {
127 console.log(res);
128 errorNotification(
129 "There was an issue",
130 `${res.message} [${res.status}] [${res.error}]`
131 )
132 });
133 }).finally(() => setFetching(false))
134
135 useEffect(() => {
136 console.log("component is mounted");

Callers 2

App.jsFile · 0.85
onFinishFunction · 0.85

Calls 2

getAllStudentsFunction · 0.90
errorNotificationFunction · 0.90

Tested by

no test coverage detected