fix add account to list in pleroma
This commit is contained in:
parent
af026a444d
commit
b2a198c6d9
|
@ -382,8 +382,12 @@ export class MastodonService {
|
||||||
addAccountToList(account: AccountInfo, listId: string, accountId: number): Promise<any> {
|
addAccountToList(account: AccountInfo, listId: string, accountId: number): Promise<any> {
|
||||||
let route = `https://${account.instance}${this.apiRoutes.addAccountToList}`.replace('{0}', listId);
|
let route = `https://${account.instance}${this.apiRoutes.addAccountToList}`.replace('{0}', listId);
|
||||||
route += `?account_ids[]=${accountId}`;
|
route += `?account_ids[]=${accountId}`;
|
||||||
|
|
||||||
|
let data = new ListAccountData();
|
||||||
|
data.account_ids.push(accountId.toString());
|
||||||
|
|
||||||
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
|
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> {
|
removeAccountFromList(account: AccountInfo, listId: string, accountId: number): Promise<any> {
|
||||||
|
@ -552,6 +556,10 @@ class ListData {
|
||||||
replies_policy: string = 'list'; //TODO
|
replies_policy: string = 'list'; //TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class ListAccountData {
|
||||||
|
account_ids: string[] = [];
|
||||||
|
}
|
||||||
|
|
||||||
class StatusData {
|
class StatusData {
|
||||||
status: string;
|
status: string;
|
||||||
in_reply_to_id: string;
|
in_reply_to_id: string;
|
||||||
|
|
Loading…
Reference in New Issue