mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 10:26:17 +00:00
Merge pull request #5941 from haiwen/mark-all-sdoc-notifications-seen
mark all sdoc notifications seen
This commit is contained in:
@@ -991,6 +991,20 @@ class SeadocNotificationsView(APIView):
|
|||||||
result = {'notifications': notifications}
|
result = {'notifications': notifications}
|
||||||
return Response(result)
|
return Response(result)
|
||||||
|
|
||||||
|
def put(self, request, file_uuid):
|
||||||
|
""" mark all notifications seen
|
||||||
|
"""
|
||||||
|
username = request.user.username
|
||||||
|
try:
|
||||||
|
SeadocNotification.objects.filter(
|
||||||
|
doc_uuid=file_uuid, username=username, seen=False).update(seen=True)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(e)
|
||||||
|
error_msg = 'Internal Server Error'
|
||||||
|
return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg)
|
||||||
|
|
||||||
|
return Response({'success': True})
|
||||||
|
|
||||||
def delete(self, request, file_uuid):
|
def delete(self, request, file_uuid):
|
||||||
"""delete notifications seen
|
"""delete notifications seen
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user