forked from magonysandormate/PeePal
Frontend hozzáadva
This commit is contained in:
1
frontend
1
frontend
Submodule frontend deleted from 4c60078551
12
frontend/peepal_react/src/apiFetch.js
Normal file
12
frontend/peepal_react/src/apiFetch.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export async function mosdokFetch() {
|
||||
try {
|
||||
const response = await fetch('http://127.0.0.1:8000/api/mosdok');
|
||||
if (!response.ok) {
|
||||
throw new Error(`Hiba: ${response.status}`);
|
||||
}
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
console.error("Hiba történt az adatok lekérésekor:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user