add of getUserNotifications function

This commit is contained in:
2025-11-16 12:13:30 +01:00
parent 4e40bba0b7
commit b5bb7b643b
2 changed files with 31 additions and 6 deletions
+21
View File
@@ -0,0 +1,21 @@
export default async function getUserNotifications() {
try {
const response = await fetch(
'http://localhost:8000/api/users/1/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;
}
}