Method for post/post

This commit is contained in:
2023-11-28 22:28:15 +03:00
parent a46a6c659f
commit 8081fbd77c
2 changed files with 23 additions and 11 deletions

View File

@@ -59,3 +59,13 @@ class Post(ApiMethod):
if 'statusCode' in data:
raise Exception(data['message'])
return neuroTypes.Post.from_dict(data)
async def get_post_to_post(self):
response = requests.get(self.api_url+f"/post/post")
data = response.json()
if 'statusCode' in data:
if response.status_code==404:
return None
else:
raise Exception(data['message'])
return neuroTypes.Post.from_dict(data)