convert API call function to TS

This commit is contained in:
p2405951 committed 2026-03-13 16:54:08 +01:00
1 parent e73d607ac3
commit 4325fe3dcb
21 files changed
+38 -59

No files matched your search

@@ -0,0 +1,21 @@
export default async function getUserNotifications() {
try {
const response = await fetch(
`${import.meta.env.VITE_API_URL}/api/users/notifications`,
{
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
}
);
const data = await response.json();
return data.data;
} catch (err) {
console.error("Erreur :", err);
return null;
}
}