refactor: move api calls to routes folder; feat: add update_banner user-friendly method; fix: change file data type

This commit is contained in:
firedotguy
2026-01-30 15:16:29 +03:00
parent d27db1d905
commit 49427a5535
13 changed files with 27 additions and 14 deletions

View File

@@ -0,0 +1,16 @@
from itd.request import fetch
def get_notifications(token: str, limit: int = 20, cursor: int = 0, type: str | None = None):
data = {'limit': str(limit), 'cursor': str(cursor)}
if type:
data['type'] = type
return fetch(token, 'get', 'notifications', data)
def mark_as_read(token: str, id: str):
return fetch(token, 'post', f'notification/{id}/read')
def mark_all_as_read(token: str):
return fetch(token, 'post', f'notification/read-all')
def get_unread_notifications_count(token: str):
return fetch(token, 'get', 'notifications/count')