This commit is contained in:
Tejas Panchal
2025-07-24 21:38:27 +05:30
parent 9f256d4254
commit 2a449a6f00
115 changed files with 11310 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import axios from "axios";
const getQtip = async (id) => {
try {
let workerUrls = import.meta.env.VITE_WORKER_URL?.split(",");
let baseUrl = workerUrls?.length
? workerUrls[Math.floor(Math.random() * workerUrls.length)]
: import.meta.env.VITE_API_URL;
if (!baseUrl) throw new Error("No API endpoint defined.");
const response = await axios.get(`${baseUrl}/qtip/${id.split("-").pop()}`);
return response.data.results;
} catch (err) {
console.error("Error fetching genre info:", err);
return null;
}
};
export default getQtip;