feat: adds list editor
feat: adds list editor
This commit is contained in:
@@ -75,4 +75,16 @@ export class MastodonApiListsService {
|
||||
return this.mastodonApiService
|
||||
.deleteAuthenticated(url, {account_ids: [accountId]}, accessToken);
|
||||
}
|
||||
|
||||
updateList(instanceName: string, accessToken: string, listId: string, newTitle: string) {
|
||||
const url = `https://${instanceName}/api/v1/lists/${listId}`;
|
||||
return this.mastodonApiService
|
||||
.putAuthenticated(url, {title: newTitle}, accessToken);
|
||||
}
|
||||
|
||||
createList(instanceName: string, accessToken: string, title: string) {
|
||||
const url = `https://${instanceName}/api/v1/lists`;
|
||||
return this.mastodonApiService
|
||||
.postAuthenticated(url, {title}, accessToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export class MastodonApiService {
|
||||
return this.httpClient.post<T>(url, parameters);
|
||||
}
|
||||
|
||||
postAuthenticated(url: string, body: { account_ids: string[] }, accessToken: string) {
|
||||
postAuthenticated(url: string, body: {}, accessToken: string) {
|
||||
const reqHeader = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + accessToken
|
||||
@@ -41,6 +41,14 @@ export class MastodonApiService {
|
||||
return this.httpClient.post(url, body, {headers: reqHeader});
|
||||
}
|
||||
|
||||
putAuthenticated(url: string, body: {}, accessToken: string) {
|
||||
const reqHeader = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + accessToken
|
||||
});
|
||||
return this.httpClient.put(url, body, {headers: reqHeader});
|
||||
}
|
||||
|
||||
deleteAuthenticated(url: string, body: { account_ids: string[] }, accessToken: string) {
|
||||
const reqHeader = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user