diff options
| author | Shpuld Shpludson <shp@cock.li> | 2017-11-14 16:34:32 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2017-11-14 16:34:32 +0000 |
| commit | dff1153d1c8394aea766e1b5fd81e87a7f3b16e7 (patch) | |
| tree | e5baa0eb0f944fa79f9332ccf3fcc23f03531355 /src/services/api/api.service.js | |
| parent | 429ec1ceab520e348dd1e4dcc5fc6bf6835bc259 (diff) | |
| parent | 07057043d96cef9d3a0087f46fa4ff14a1f6788f (diff) | |
Merge branch 'fix/user-view-without-posts' into 'develop'
Use state object for user view instead of timeline.
See merge request pleroma/pleroma-fe!161
Diffstat (limited to 'src/services/api/api.service.js')
| -rw-r--r-- | src/services/api/api.service.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 5abaea7e..5de0a457 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -28,7 +28,7 @@ const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json' const QVITTER_USER_TIMELINE_URL = '/api/qvitter/statuses/user_timeline.json' const BLOCKING_URL = '/api/blocks/create.json' const UNBLOCKING_URL = '/api/blocks/destroy.json' -// const USER_URL = '/api/users/show.json' +const USER_URL = '/api/users/show.json' import { each, map } from 'lodash' import 'whatwg-fetch' @@ -202,6 +202,12 @@ const unblockUser = ({id, credentials}) => { }).then((data) => data.json()) } +const fetchUser = ({id, credentials}) => { + let url = `${USER_URL}?user_id=${id}` + return fetch(url, { headers: authHeaders(credentials) }) + .then((data) => data.json()) +} + const fetchFriends = ({id, credentials}) => { let url = `${FRIENDS_URL}?user_id=${id}` return fetch(url, { headers: authHeaders(credentials) }) @@ -363,6 +369,7 @@ const apiService = { unfollowUser, blockUser, unblockUser, + fetchUser, favorite, unfavorite, retweet, |
