This commit is contained in:
parent
cbb4064e6d
commit
aaf30ec115
|
@ -66,8 +66,8 @@ def get_notifications(author_id: int, session, limit: int, offset: int) -> List[
|
||||||
|
|
||||||
@strawberry.type
|
@strawberry.type
|
||||||
class Query:
|
class Query:
|
||||||
@strawberry.field
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@strawberry.field
|
||||||
async def load_notifications(self, info, limit: int = 50, offset: int = 0) -> NotificationsResult:
|
async def load_notifications(self, info, limit: int = 50, offset: int = 0) -> NotificationsResult:
|
||||||
author_id = info.context.get("author_id")
|
author_id = info.context.get("author_id")
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
|
@ -88,8 +88,8 @@ class Query:
|
||||||
|
|
||||||
@strawberry.type
|
@strawberry.type
|
||||||
class Mutation:
|
class Mutation:
|
||||||
@strawberry.mutation
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@strawberry.mutation
|
||||||
async def mark_notification_as_read(self, info, notification_id: int) -> NotificationSeenResult:
|
async def mark_notification_as_read(self, info, notification_id: int) -> NotificationSeenResult:
|
||||||
author_id = info.context.get("author_id")
|
author_id = info.context.get("author_id")
|
||||||
if author_id:
|
if author_id:
|
||||||
|
@ -105,8 +105,8 @@ class Mutation:
|
||||||
return nsr
|
return nsr
|
||||||
return NotificationSeenResult()
|
return NotificationSeenResult()
|
||||||
|
|
||||||
@strawberry.mutation
|
|
||||||
@login_required
|
@login_required
|
||||||
|
@strawberry.mutation
|
||||||
async def mark_all_notifications_as_read(self, info) -> NotificationSeenResult:
|
async def mark_all_notifications_as_read(self, info) -> NotificationSeenResult:
|
||||||
author_id = info.context.get("author_id")
|
author_id = info.context.get("author_id")
|
||||||
if author_id:
|
if author_id:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user