Deleted posts command

This commit is contained in:
2024-02-15 12:16:47 +03:00
parent f1d1fa1914
commit 77a916dc0b
3 changed files with 32 additions and 1 deletions

View File

@@ -111,4 +111,11 @@ class Post(ApiMethod):
response = requests.delete(self.api_url+f"/post/delete-post-by-order/{order}")
data = response.json()
if 'statusCode' in data:
raise Exception(data['message'])
raise Exception(data['message'])
async def get_deleted_posts(self) -> List[neuroTypes.Post]:
async with ClientSession() as session:
response = await session.get(self.api_url+f'/post/get-deleted')
data = await response.json()
if 'statusCode' in data:
raise Exception(data['message'])
return [neuroTypes.Post.from_dict(post) for post in data]