delete unecessary admin listener

This commit is contained in:
2026-03-28 15:56:16 +01:00
parent d2ad9e348e
commit 6fcf45d4ff
@@ -1,24 +0,0 @@
export const adminNotificationsListener = (echo, userData, setNotifications, setUnreadNotification, updatePendingMembers) => {
if (userData.isAdmin) {
const channelName = "users.admin";
const handleNotification = (id, content) => {
const newNotification = {
id,
content,
created_at: new Date().toISOString(),
pivot: { unread: 1 }
};
setNotifications(prev => [newNotification, ...prev]);
setUnreadNotification(true);
};
echo.private(channelName)
.listen(".users.registration", (event) => {
handleNotification(event.notificationId, `Nouvelle demande d'inscription : ${event.user.name} ${event.user.lastname}`);
updatePendingMembers();
});
return channelName;
}
return null;
};