Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Added returning post url in post (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
spietras authored Oct 17, 2022
1 parent ef11d61 commit 9c54496
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,15 @@ async def set_config(
)
return json.loads(response.config)

async def post(self, post: Dict[str, Any], *args, **kwargs) -> UUID:
async def post(
self, post: Dict[str, Any], *args, **kwargs
) -> Tuple[UUID, Optional[str]]:
response = await self._stub.post(
PostRequest(post=GeneratedPost(content=json.dumps(post))),
*args,
**kwargs,
)
return UUID(response.post_id)
return UUID(response.post_id), response.post_url

async def score(self, post_id: UUID, *args, **kwargs) -> float:
response = await self._stub.score(
Expand Down

0 comments on commit 9c54496

Please sign in to comment.