From b2a198c6d9ad6a5be91608b49347622a4220df87 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Mon, 4 Jan 2021 02:13:02 -0500 Subject: [PATCH] fix add account to list in pleroma --- src/app/services/mastodon.service.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/services/mastodon.service.ts b/src/app/services/mastodon.service.ts index e9bd0b96..4c5c7a3f 100644 --- a/src/app/services/mastodon.service.ts +++ b/src/app/services/mastodon.service.ts @@ -382,8 +382,12 @@ export class MastodonService { addAccountToList(account: AccountInfo, listId: string, accountId: number): Promise { 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 { @@ -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;