schema-fix
Some checks failed
deploy / deploy (push) Failing after 1m41s

This commit is contained in:
2023-11-24 05:45:38 +03:00
parent b172b4ef84
commit 4630299a56
3 changed files with 60 additions and 9 deletions

View File

@@ -5,6 +5,10 @@ from services.db import local_session
from services.schema import mutation, query
from orm.notification import Notification
# TODO: occurrencies?
# TODO: use of Author.id?
@query.field("loadNotifications")
@login_required
@@ -16,12 +20,7 @@ async def load_notifications(_, info, params=None):
limit = params.get("limit", 50)
offset = params.get("offset", 0)
q = (
select(Notification)
.order_by(desc(Notification.created_at))
.limit(limit)
.offset(offset)
)
q = select(Notification).order_by(desc(Notification.created_at)).limit(limit).offset(offset)
notifications = []
with local_session() as session:
@@ -39,8 +38,8 @@ async def load_notifications(_, info, params=None):
return {
"notifications": notifications,
"totalCount": total_count,
"totalUnreadCount": total_unread_count,
"total": total_count,
"unread": total_unread_count,
}