feat: add models final part 5

This commit is contained in:
firedotguy
2026-02-07 17:23:42 +03:00
parent f33ed4f76a
commit 506e6a5d09
10 changed files with 189 additions and 57 deletions

View File

@@ -1,4 +1,9 @@
from itd.request import fetch
from uuid import UUID
def report(token: str, id: str, type: str = 'post', reason: str = 'other', description: str = ''):
return fetch(token, 'post', 'reports', {'targetId': id, 'targetType': type, 'reason': reason, 'description': description})
from itd.request import fetch
from itd.enums import ReportTargetReason, ReportTargetType
def report(token: str, id: UUID, type: ReportTargetType = ReportTargetType.POST, reason: ReportTargetReason = ReportTargetReason.OTHER, description: str | None = None):
if description is None:
description = ''
return fetch(token, 'post', 'reports', {'targetId': str(id), 'targetType': type.value, 'reason': reason.value, 'description': description})