async def get_reports(self, open=None, limit=None):
args = {
+ "list" : self.slug,
"open" : open,
"limit" : limit,
}
# Send the request
- response = await self._backend.dbl._fetch(
- "/lists/%s/reports" % self.slug, args=args,
- )
+ response = await self._backend.dbl._fetch("/reports", args=args)
return [Report(self._backend, **data) for data in response]
"""
# Compose the request body
body = {
- "name" : name,
- "comment" : comment,
- "block" : block
+ "list" : self.slug,
+ "name" : name,
+ "comment" : comment,
+ "block" : block
}
# Submit the report
response = await self._backend.dbl._fetch(
- "/lists/%s/reports" % self.slug, method="POST", body=body, as_user=reported_by,
+ "/reports", method="POST", body=body, as_user=reported_by,
)
# Return the report