Skip to content
Snippets Groups Projects
Commit 462ca3bf authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Update API urls to support special chars in pack names

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