Add user finder.

This commit is contained in:
Roger Braun 2017-05-12 18:54:12 +02:00
parent 1f8d303863
commit 2ec7069b3c
6 changed files with 49 additions and 3 deletions

View file

@ -17,6 +17,7 @@ const FRIENDS_URL = '/api/statuses/friends.json'
const FOLLOWING_URL = '/api/friendships/create.json'
const UNFOLLOWING_URL = '/api/friendships/destroy.json'
const QVITTER_USER_PREF_URL = '/api/qvitter/set_profile_pref.json'
const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json'
// const USER_URL = '/api/users/show.json'
const oldfetch = window.fetch
@ -35,6 +36,13 @@ const authHeaders = (user) => {
}
}
const externalProfile = (profileUrl) => {
let url = `${EXTERNAL_PROFILE_URL}?profileurl=${profileUrl}`
return fetch(url, {
method: 'GET'
}).then((data) => data.json())
}
const followUser = ({id, credentials}) => {
let url = `${FOLLOWING_URL}?user_id=${id}`
return fetch(url, {
@ -198,7 +206,8 @@ const apiService = {
uploadMedia,
fetchAllFollowing,
setUserMute,
fetchMutes
fetchMutes,
externalProfile
}
export default apiService