Make marking notifs as read POST, not GET

This commit is contained in:
Peter Vacho 2024-12-31 01:30:56 +01:00
parent 0f820d12e3
commit bb943c8e7e
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -89,7 +89,7 @@ async def get_notification(notification_id: PydanticObjectId, user: CurrentUserD
return NotificationData.from_notification(notification) return NotificationData.from_notification(notification)
@notifications_router.get("/{notification_id}/read") @notifications_router.post("/{notification_id}/read")
async def read_notification(notification_id: PydanticObjectId, user: CurrentUserDep) -> NotificationData: async def read_notification(notification_id: PydanticObjectId, user: CurrentUserDep) -> NotificationData:
"""Mark a notification as read.""" """Mark a notification as read."""
notification = await Notification.get(notification_id, fetch_links=True) notification = await Notification.get(notification_id, fetch_links=True)