From 2eb1d2b8409adff8c0f5160ec9eddc1c360b89da Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Mon, 17 Aug 2020 23:44:29 +0300 Subject: [PATCH 1/6] Update relay URL when unfollowing a relay --- src/api/relays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/relays.js b/src/api/relays.js index 3be0188d..100ad396 100644 --- a/src/api/relays.js +++ b/src/api/relays.js @@ -27,7 +27,7 @@ export async function deleteRelay(relay, authHost, token) { url: '/api/pleroma/admin/relay', method: 'delete', headers: authHeaders(token), - data: { relay_url: `https://${relay}/actor` } + data: { relay_url: `https://${relay}` } }) } From 04c10cf5e664510026b548b8b20d68949870dfdc Mon Sep 17 00:00:00 2001 From: Angelina Filippova Date: Wed, 19 Aug 2020 00:47:07 +0300 Subject: [PATCH 2/6] Fix fetching relays, add Followed Back field --- src/api/relays.js | 8 ++++---- src/lang/en.js | 1 + src/store/modules/relays.js | 5 ++--- src/views/settings/components/Relays.vue | 22 +++++++++++++--------- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/api/relays.js b/src/api/relays.js index 100ad396..7891917e 100644 --- a/src/api/relays.js +++ b/src/api/relays.js @@ -11,23 +11,23 @@ export async function fetchRelays(authHost, token) { }) } -export async function addRelay(relay, authHost, token) { +export async function addRelay(relay_url, authHost, token) { return await request({ baseURL: baseName(authHost), url: '/api/pleroma/admin/relay', method: 'post', headers: authHeaders(token), - data: { relay_url: relay } + data: { relay_url } }) } -export async function deleteRelay(relay, authHost, token) { +export async function deleteRelay(relay_url, authHost, token) { return await request({ baseURL: baseName(authHost), url: '/api/pleroma/admin/relay', method: 'delete', headers: authHeaders(token), - data: { relay_url: `https://${relay}` } + data: { relay_url } }) } diff --git a/src/lang/en.js b/src/lang/en.js index 2008aec8..6181cf32 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -406,6 +406,7 @@ export default { relays: 'Relays', follow: 'Follow', followRelay: 'Follow new relay', + followedBack: 'Followed Back', instanceUrl: 'Instance URL', success: 'Settings changed successfully!', description: 'Description', diff --git a/src/store/modules/relays.js b/src/store/modules/relays.js index 3a0d15cc..555886a2 100644 --- a/src/store/modules/relays.js +++ b/src/store/modules/relays.js @@ -23,9 +23,8 @@ const relays = { async FetchRelays({ commit, getters }) { commit('SET_LOADING', true) - const response = await fetchRelays(getters.authHost, getters.token) - - commit('SET_RELAYS', response.data.relays) + const { data } = await fetchRelays(getters.authHost, getters.token) + commit('SET_RELAYS', data.relays) commit('SET_LOADING', false) }, async AddRelay({ commit, dispatch, getters }, relay) { diff --git a/src/views/settings/components/Relays.vue b/src/views/settings/components/Relays.vue index eb3ac264..4ce16a56 100644 --- a/src/views/settings/components/Relays.vue +++ b/src/views/settings/components/Relays.vue @@ -4,16 +4,25 @@