fix list creation in pleroma

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

View File

@ -357,7 +357,11 @@ export class MastodonService {
createList(account: AccountInfo, title: string): Promise<StreamElement> {
let route = `https://${account.instance}${this.apiRoutes.postList}?title=${title}`;
const headers = new HttpHeaders({ 'Authorization': `Bearer ${account.token.access_token}` });
return this.httpClient.post<List>(route, null, { headers: headers }).toPromise()
let data = new ListData();
data.title = title;
return this.httpClient.post<List>(route, data, { headers: headers }).toPromise()
.then((list: List) => {
return new StreamElement(StreamTypeEnum.list, list.title, account.id, null, list.title, list.id, account.instance);
});
@ -543,6 +547,11 @@ class PollData {
choices: number[];
}
class ListData {
title: string;
replies_policy: string = 'list'; //TODO
}
class StatusData {
status: string;
in_reply_to_id: string;