mirror of
https://github.com/JustAnimeCore/JustAnime.git
synced 2026-04-18 06:11:45 +00:00
Landing page
This commit is contained in:
12
src/utils/getEpisodes.utils.js
Normal file
12
src/utils/getEpisodes.utils.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import axios from "axios";
|
||||
|
||||
export default async function getEpisodes(id) {
|
||||
const api_url = import.meta.env.VITE_API_URL;
|
||||
try {
|
||||
const response = await axios.get(`${api_url}/episodes/${id}`);
|
||||
return response.data.results;
|
||||
} catch (error) {
|
||||
console.error("Error fetching anime info:", error);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user