Replace /api/externalprofile/show.json with a MastoAPI equialent

`/api/v1/accounts/:id` supports remote nicknames since pleroma!1622
This commit is contained in:
rinpatch 2019-09-03 19:59:28 +03:00
parent 49159e6db3
commit 457290e81e
4 changed files with 2 additions and 15 deletions

View file

@ -26,7 +26,7 @@ const WhoToFollow = {
} }
this.users.push(user) this.users.push(user)
this.$store.state.api.backendInteractor.externalProfile(user.screen_name) this.$store.state.api.backendInteractor.fetchUser({ id: user.screen_name })
.then((externalUser) => { .then((externalUser) => {
if (!externalUser.error) { if (!externalUser.error) {
this.$store.commit('addNewUsers', [externalUser]) this.$store.commit('addNewUsers', [externalUser])

View file

@ -13,7 +13,7 @@ function showWhoToFollow (panel, reply) {
toFollow.img = img toFollow.img = img
toFollow.name = name toFollow.name = name
panel.$store.state.api.backendInteractor.externalProfile(name) panel.$store.state.api.backendInteractor.fetchUser({ id: name })
.then((externalUser) => { .then((externalUser) => {
if (!externalUser.error) { if (!externalUser.error) {
panel.$store.commit('addNewUsers', [externalUser]) panel.$store.commit('addNewUsers', [externalUser])

View file

@ -4,7 +4,6 @@ import 'whatwg-fetch'
import { RegistrationError, StatusCodeError } from '../errors/errors' import { RegistrationError, StatusCodeError } from '../errors/errors'
/* eslint-env browser */ /* eslint-env browser */
const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json'
const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json' const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json'
const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import' const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import'
const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import' const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import'
@ -220,14 +219,6 @@ const authHeaders = (accessToken) => {
} }
} }
const externalProfile = ({ profileUrl, credentials }) => {
let url = `${EXTERNAL_PROFILE_URL}?profileurl=${profileUrl}`
return fetch(url, {
headers: authHeaders(credentials),
method: 'GET'
}).then((data) => data.json())
}
const followUser = ({ id, credentials }) => { const followUser = ({ id, credentials }) => {
let url = MASTODON_FOLLOW_URL(id) let url = MASTODON_FOLLOW_URL(id)
return fetch(url, { return fetch(url, {
@ -966,7 +957,6 @@ const apiService = {
updateBg, updateBg,
updateProfile, updateProfile,
updateBanner, updateBanner,
externalProfile,
importBlocks, importBlocks,
importFollows, importFollows,
deleteAccount, deleteAccount,

View file

@ -127,8 +127,6 @@ const backendInteractorService = credentials => {
const updateBanner = ({ banner }) => apiService.updateBanner({ credentials, banner }) const updateBanner = ({ banner }) => apiService.updateBanner({ credentials, banner })
const updateProfile = ({ params }) => apiService.updateProfile({ credentials, params }) const updateProfile = ({ params }) => apiService.updateProfile({ credentials, params })
const externalProfile = (profileUrl) => apiService.externalProfile({ profileUrl, credentials })
const importBlocks = (file) => apiService.importBlocks({ file, credentials }) const importBlocks = (file) => apiService.importBlocks({ file, credentials })
const importFollows = (file) => apiService.importFollows({ file, credentials }) const importFollows = (file) => apiService.importFollows({ file, credentials })
@ -194,7 +192,6 @@ const backendInteractorService = credentials => {
updateBg, updateBg,
updateBanner, updateBanner,
updateProfile, updateProfile,
externalProfile,
importBlocks, importBlocks,
importFollows, importFollows,
deleteAccount, deleteAccount,