1
0
mirror of https://github.com/ihabunek/toot.git synced 2024-06-23 06:25:26 +00:00

Added vote method to api

This commit is contained in:
Daniel Schwarz 2023-02-10 21:44:37 -05:00
parent 6a6225caa5
commit b50fb9d9fd

View File

@ -361,6 +361,12 @@ def whois(app, user, account):
return http.get(app, user, f'/api/v1/accounts/{account}').json()
def vote(app, user, poll_id, choices: list):
url = f"/api/v1/polls/{poll_id}/votes"
json = {'choices': choices}
return http.post(app, user, url, json=json).json()
def mute(app, user, account):
return _account_action(app, user, account, 'mute')