fix poll vote in pleroma

This commit is contained in:
Nicolas Constant 2020-12-22 19:55:12 -05:00
parent 438867e49a
commit d74b030688
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 8 additions and 1 deletions

View File

@ -393,8 +393,11 @@ export class MastodonService {
let route = `https://${account.instance}${this.apiRoutes.voteOnPoll}`.replace('{0}', pollId);
route += `?${this.formatArray(pollSelection.map(x => x.toString()), 'choices')}`;
let data = new PollData();
data.choices = pollSelection;
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
return this.httpClient.post<Poll>(route, null, { headers: headers }).toPromise();
return this.httpClient.post<Poll>(route, data, { headers: headers }).toPromise();
}
getPoll(account: AccountInfo, pollId: string): Promise<Poll> {
@ -536,6 +539,10 @@ export enum VisibilityEnum {
Direct = 4
}
class PollData {
choices: number[];
}
class StatusData {
status: string;
in_reply_to_id: string;