Added vote method to api

This commit is contained in:
Daniel Schwarz 2023-02-10 21:44:37 -05:00
parent 6a6225caa5
commit b50fb9d9fd
1 changed files with 6 additions and 0 deletions

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')