fix add account to list in pleroma

This commit is contained in:
Nicolas Constant 2021-01-04 02:13:02 -05:00
parent af026a444d
commit b2a198c6d9
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 9 additions and 1 deletions

View File

@ -382,8 +382,12 @@ export class MastodonService {
addAccountToList(account: AccountInfo, listId: string, accountId: number): Promise<any> {
let route = `https://${account.instance}${this.apiRoutes.addAccountToList}`.replace('{0}', listId);
route += `?account_ids[]=${accountId}`;
let data = new ListAccountData();
data.account_ids.push(accountId.toString());
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
return this.httpClient.post(route, null, { headers: headers }).toPromise();
return this.httpClient.post(route, data, { headers: headers }).toPromise();
}
removeAccountFromList(account: AccountInfo, listId: string, accountId: number): Promise<any> {
@ -552,6 +556,10 @@ class ListData {
replies_policy: string = 'list'; //TODO
}
class ListAccountData {
account_ids: string[] = [];
}
class StatusData {
status: string;
in_reply_to_id: string;