api: turn MASTODON_USER_URL into a function
This commit is contained in:
parent
fb2fc686b1
commit
4f0eabbd55
1 changed files with 2 additions and 2 deletions
|
@ -47,7 +47,7 @@ const MASTODON_PUBLIC_TIMELINE = '/api/v1/timelines/public'
|
|||
const MASTODON_USER_HOME_TIMELINE_URL = '/api/v1/timelines/home'
|
||||
const MASTODON_STATUS_URL = id => `/api/v1/statuses/${id}`
|
||||
const MASTODON_STATUS_CONTEXT_URL = id => `/api/v1/statuses/${id}/context`
|
||||
const MASTODON_USER_URL = '/api/v1/accounts'
|
||||
const MASTODON_USER_URL = id => `/api/v1/accounts/${id}?with_relationships=true`
|
||||
const MASTODON_USER_RELATIONSHIPS_URL = '/api/v1/accounts/relationships'
|
||||
const MASTODON_USER_TIMELINE_URL = id => `/api/v1/accounts/${id}/statuses`
|
||||
const MASTODON_LIST_URL = id => `/api/v1/lists/${id}`
|
||||
|
@ -311,7 +311,7 @@ const denyUser = ({ id, credentials }) => {
|
|||
}
|
||||
|
||||
const fetchUser = ({ id, credentials }) => {
|
||||
let url = `${MASTODON_USER_URL}/${id}` + '?with_relationships=true'
|
||||
const url = MASTODON_USER_URL(id)
|
||||
return promisedRequest({ url, credentials })
|
||||
.then((data) => parseUser(data))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue