{{ $t('lists.lists') }}
+
`/api/v1/accounts/${id}/statuses`
const MASTODON_LIST_TIMELINE_URL = id => `/api/v1/timelines/list/${id}`
+const MASTODON_LIST_ACCOUNTS_URL = id => `/api/v1/lists/${id}/accounts`
const MASTODON_TAG_TIMELINE_URL = tag => `/api/v1/timelines/tag/${tag}`
const MASTODON_BOOKMARK_TIMELINE_URL = '/api/v1/bookmarks'
const MASTODON_USER_BLOCKS_URL = '/api/v1/blocks/'
@@ -390,6 +391,30 @@ const fetchLists = ({ credentials }) => {
.then((data) => data.json())
}
+const createList = ({ title, credentials }) => {
+ const url = MASTODON_LISTS_URL
+ const headers = authHeaders(credentials)
+ headers['Content-Type'] = 'application/json'
+
+ return fetch(url, {
+ method: 'POST',
+ headers: headers,
+ body: JSON.stringify({ title })
+ }).then((data) => data.json())
+}
+
+const addAccountsToList = ({ id, accountIds, credentials }) => {
+ const url = MASTODON_LIST_ACCOUNTS_URL(id)
+ const headers = authHeaders(credentials)
+ headers['Content-Type'] = 'application/json'
+
+ return fetch(url, {
+ method: 'POST',
+ headers: headers,
+ body: JSON.stringify({ account_ids: accountIds })
+ })
+}
+
const fetchConversation = ({ id, credentials }) => {
let urlContext = MASTODON_STATUS_CONTEXT_URL(id)
return fetch(urlContext, { headers: authHeaders(credentials) })
@@ -1363,6 +1388,8 @@ const apiService = {
mfaConfirmOTP,
fetchFollowRequests,
fetchLists,
+ createList,
+ addAccountsToList,
approveUser,
denyUser,
suggestions,