diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a873ae..45eb0a9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Fixed + +- Fix following and unfollowing relays from Admin-FE, update mobile UI + ## [2.1] - 2020-08-14 ### Added diff --git a/src/api/relays.js b/src/api/relays.js index 3be0188d..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}/actor` } + data: { relay_url } }) } diff --git a/src/lang/en.js b/src/lang/en.js index 2008aec8..8e9629b2 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -150,7 +150,8 @@ export default { draft: 'Draft', delete: 'Delete', cancel: 'Cancel', - confirm: 'Confirm' + confirm: 'Confirm', + unfollow: 'Unfollow' }, errorLog: { tips: 'Please click the bug icon in the upper right corner', @@ -406,6 +407,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..2d611c0e 100644 --- a/src/store/modules/relays.js +++ b/src/store/modules/relays.js @@ -13,19 +13,18 @@ const relays = { state.fetchedRelays = relays }, ADD_RELAY: (state, relay) => { - state.fetchedRelays = [...state.fetchedRelays, relay] + state.fetchedRelays = [...state.fetchedRelays, { actor: relay }] }, DELETE_RELAY: (state, relay) => { - state.fetchedRelays = state.fetchedRelays.filter(fetchedRelay => fetchedRelay !== relay) + state.fetchedRelays = state.fetchedRelays.filter(fetchedRelay => fetchedRelay.actor !== relay) } }, actions: { 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..4ac29042 100644 --- a/src/views/settings/components/Relays.vue +++ b/src/views/settings/components/Relays.vue @@ -2,19 +2,28 @@