Update Emoji routes

This commit is contained in:
Angelina Filippova 2020-09-21 20:41:27 +03:00
parent c5e3aa7f5a
commit 661b828e5c

View file

@ -14,7 +14,7 @@ export async function addNewEmojiFile(packName, file, shortcode, filename, host,
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/files?name=${encodeUri(packName)}`,
url: `/api/pleroma/emoji/packs/files?name=${packName}`,
method: 'post',
headers: authHeaders(token),
data
@ -28,7 +28,7 @@ export function addressOfEmojiInPack(host, packName, name) {
export async function createPack(host, token, packName) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/create?name=${encodeUri(packName)}`,
url: `/api/pleroma/emoji/pack?name=${packName}`,
method: 'post',
headers: authHeaders(token)
})
@ -37,7 +37,7 @@ export async function createPack(host, token, packName) {
export async function deleteEmojiFile(packName, shortcode, host, token) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/files?name=${encodeUri(packName)}&shortcode=${shortcode}`,
url: `/api/pleroma/emoji/packs/files?name=${packName}&shortcode=${shortcode}`,
method: 'delete',
headers: authHeaders(token)
})
@ -46,7 +46,7 @@ export async function deleteEmojiFile(packName, shortcode, host, token) {
export async function deletePack(host, token, packName) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/delete?name=${encodeUri(packName)}`,
url: `/api/pleroma/emoji/pack?name=${packName}`,
method: 'delete',
headers: authHeaders(token)
})
@ -68,7 +68,7 @@ export async function downloadFrom(instanceAddress, packName, as, host, token) {
export async function fetchPack(packName, page, pageSize, host, token) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/show?name=${encodeUri(packName)}&page=${page}&page_size=${pageSize}`,
url: `/api/pleroma/emoji/pack?name=${packName}&page=${page}&page_size=${pageSize}`,
method: 'get',
headers: authHeaders(token)
})
@ -113,7 +113,7 @@ export async function reloadEmoji(host, token) {
export async function savePackMetadata(host, token, packName, metadata) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/update?name=${encodeUri(packName)}`,
url: `/api/pleroma/emoji/pack?name=${packName}`,
method: 'patch',
headers: authHeaders(token),
data: { metadata },
@ -124,7 +124,7 @@ export async function savePackMetadata(host, token, packName, metadata) {
export async function updateEmojiFile(packName, shortcode, newShortcode, newFilename, force, host, token) {
return await request({
baseURL: baseName(host),
url: `/api/pleroma/emoji/packs/files?name=${encodeUri(packName)}`,
url: `/api/pleroma/emoji/packs/files?name=${packName}`,
method: 'patch',
headers: authHeaders(token),
data: { shortcode, new_shortcode: newShortcode, new_filename: newFilename, force }