refactor: remove .js extensions from imports

This commit is contained in:
p2405951
2026-03-13 15:27:42 +01:00
parent 00f6177842
commit 4bb0ed60ad
17 changed files with 22 additions and 63 deletions
+1 -42
View File
@@ -1,44 +1,3 @@
/*export default async function fetchWrapper(path,data = null,method = "GET",headers = {}) {
try {
const res = await fetch(
`${import.meta.env.VITE_API_URL}${path}`,
{
method,
credentials: "include",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
...headers,
},
body: data ? JSON.stringify(data) : null,
}
);
let responseData = null;
try {
responseData = await res.json();
} catch (_) {
responseData = null;
}
return {
status: res.status,
data: responseData,
};
} catch (err) {
console.error("❌ Erreur réseau :", err);
return {
status: 0,
data: {
message: "Network error",
},
};
}
}*/
interface FetchResponse<T = any> {
status: number;
data: T | null;
@@ -79,7 +38,7 @@ export default async function fetchWrapper(
};
} catch (err) {
console.error("Erreur réseau :", err);
console.error("Erreur réseau :", err);
return {
status: 0,