logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: bc9ed3642441fa77900d4698eebf8cd6380ccaaa
parent: 671ecfb1521ab3ff4f853671866ac189a64aadf5
Author: lain <lain@soykaf.club>
Date:   Sun, 17 May 2020 07:27:07 +0000

Merge branch 'feat/add-embed-relationships' into 'develop'

Add `with_relationships` query param

Closes #838

See merge request pleroma/pleroma-fe!1107

Diffstat:

Msrc/components/post_status_form/post_status_form.js2+-
Msrc/components/user_settings/user_settings.js4++--
Msrc/modules/users.js2+-
Msrc/services/api/api.service.js8++++++--
4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js @@ -102,7 +102,7 @@ const PostStatusForm = { ...this.$store.state.instance.customEmoji ], users: this.$store.state.users.users, - updateUsersList: (input) => this.$store.dispatch('searchUsers', input) + updateUsersList: (query) => this.$store.dispatch('searchUsers', { query }) }) }, emojiSuggestor () { diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js @@ -112,7 +112,7 @@ const UserSettings = { ...this.$store.state.instance.customEmoji ], users: this.$store.state.users.users, - updateUsersList: (input) => this.$store.dispatch('searchUsers', input) + updateUsersList: (query) => this.$store.dispatch('searchUsers', { query }) }) }, emojiSuggestor () { @@ -362,7 +362,7 @@ const UserSettings = { }) }, queryUserIds (query) { - return this.$store.dispatch('searchUsers', query) + return this.$store.dispatch('searchUsers', { query }) .then((users) => map(users, 'id')) }, blockUsers (ids) { diff --git a/src/modules/users.js b/src/modules/users.js @@ -428,7 +428,7 @@ const users = { store.commit('setUserForNotification', notification) }) }, - searchUsers (store, query) { + searchUsers (store, { query }) { return store.rootState.api.backendInteractor.searchUsers({ query }) .then((users) => { store.commit('addNewUsers', users) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js @@ -324,7 +324,8 @@ const fetchFriends = ({ id, maxId, sinceId, limit = 20, credentials }) => { const args = [ maxId && `max_id=${maxId}`, sinceId && `since_id=${sinceId}`, - limit && `limit=${limit}` + limit && `limit=${limit}`, + `with_relationships=true` ].filter(_ => _).join('&') url = url + (args ? '?' + args : '') @@ -358,7 +359,8 @@ const fetchFollowers = ({ id, maxId, sinceId, limit = 20, credentials }) => { const args = [ maxId && `max_id=${maxId}`, sinceId && `since_id=${sinceId}`, - limit && `limit=${limit}` + limit && `limit=${limit}`, + `with_relationships=true` ].filter(_ => _).join('&') url += args ? '?' + args : '' @@ -971,6 +973,8 @@ const search2 = ({ credentials, q, resolve, limit, offset, following }) => { params.push(['following', true]) } + params.push(['with_relationships', true]) + let queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&') url += `?${queryString}`