Skip to content
Snippets Groups Projects
Commit 10d3f3f0 authored by vaartis's avatar vaartis
Browse files

Use the remote pack listing endpoint

parent f2c2a959
No related branches found
No related tags found
1 merge request!48More annoying fixes for the emoji packs
......@@ -48,6 +48,16 @@ export async function listPacks(host) {
})
}
export async function listRemotePacks(host, token, instance) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/list_from`,
method: 'post',
headers: authHeaders(token),
data: { instance_address: instance }
})
}
export async function downloadFrom(host, instance_address, pack_name, as, token) {
if (as.trim() === '') {
as = null
......
import { listPacks,
import {
listPacks,
listRemotePacks,
downloadFrom,
reloadEmoji,
createPack,
......@@ -47,7 +49,8 @@ const packs = {
commit('SET_LOCAL_PACKS', data)
},
async SetRemoteEmojiPacks({ commit, getters, state }, { remoteInstance }) {
const { data } = await listPacks(remoteInstance)
const { data } = await listRemotePacks(getters.authHost, getters.token, remoteInstance)
commit('SET_REMOTE_PACKS', data)
},
async DownloadFrom({ commit, getters, state }, { instanceAddress, packName, as }) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment