From a3ae2aad5b6286f7afde885444388f2e36b3d2e7 Mon Sep 17 00:00:00 2001 From: Essem Date: Sat, 6 Jan 2024 21:07:15 -0600 Subject: [PATCH] Fix emoji reactions --- src/modules/statuses.js | 6 +++--- src/services/api/api.service.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 649916a1..1f4de887 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -544,7 +544,7 @@ export const mutations = { count: reaction.count + 1, me: true, accounts: [ - ...reaction.accounts, + //...reaction.accounts, currentUser ] } @@ -734,7 +734,7 @@ const statuses = { if (!currentUser) return commit('addOwnReaction', { id, emoji, currentUser }) - rootState.api.backendInteractor.reactWithEmoji({ id, emoji }).then( + rootState.api.backendInteractor.reactWithEmoji({ id, emoji: emoji.replaceAll(':', '') }).then( ok => { dispatch('fetchEmojiReactionsBy', id) } @@ -745,7 +745,7 @@ const statuses = { if (!currentUser) return commit('removeOwnReaction', { id, emoji, currentUser }) - rootState.api.backendInteractor.unreactWithEmoji({ id, emoji }).then( + rootState.api.backendInteractor.unreactWithEmoji({ id, emoji: emoji.replaceAll(':', '') }).then( ok => { dispatch('fetchEmojiReactionsBy', id) } diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 226ecc95..84316196 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -101,7 +101,7 @@ const MASTODON_ANNOUNCEMENTS_URL = '/api/v1/announcements' const MASTODON_ANNOUNCEMENTS_DISMISS_URL = id => `/api/v1/announcements/${id}/dismiss` const PLEROMA_EMOJI_REACTIONS_URL = id => `/api/v1/statuses/${id}/reactions` const PLEROMA_EMOJI_REACT_URL = (id, emoji) => `/api/v1/statuses/${id}/react/${emoji}` -const PLEROMA_EMOJI_UNREACT_URL = (id, emoji) => `/api/v1/statuses/${id}/react/${emoji}` +const PLEROMA_EMOJI_UNREACT_URL = (id, emoji) => `/api/v1/statuses/${id}/unreact/${emoji}` const PLEROMA_BACKUP_URL = '/api/v1/pleroma/backups' const PLEROMA_ANNOUNCEMENTS_URL = '/api/v1/pleroma/admin/announcements' const PLEROMA_POST_ANNOUNCEMENT_URL = '/api/v1/pleroma/admin/announcements' @@ -1341,7 +1341,7 @@ const fetchEmojiReactions = ({ id, credentials }) => { const reactWithEmoji = ({ id, emoji, credentials }) => { return promisedRequest({ url: PLEROMA_EMOJI_REACT_URL(id, encodeURIComponent(emoji)), - method: 'PUT', + method: 'POST', credentials }).then(parseStatus) } @@ -1349,7 +1349,7 @@ const reactWithEmoji = ({ id, emoji, credentials }) => { const unreactWithEmoji = ({ id, emoji, credentials }) => { return promisedRequest({ url: PLEROMA_EMOJI_UNREACT_URL(id, encodeURIComponent(emoji)), - method: 'DELETE', + method: 'POST', credentials }).then(parseStatus) }