Archived
getEvents api function
This commit is contained in:
1 parent
2217fb2634
commit
3632500387
1 file changed
+8
@@ -0,0 +1,8 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import { BACKEND_URL } from "../../constants";
|
||||||
|
|
||||||
|
export const getEvents = async () => {
|
||||||
|
const rq = await axios.get(`${BACKEND_URL}/api/getEvents`);
|
||||||
|
if (rq.status !== 200) throw new Error(`Request failed with code ${rq.status}: ${rq.statusText}`);
|
||||||
|
return rq.data;
|
||||||
|
};
|
||||||
Reference in new issue
Block a user