Don't use too advanced features.
This commit is contained in:
parent
bbb9a9c93c
commit
48a6d2e987
1 changed files with 3 additions and 1 deletions
|
@ -23,6 +23,8 @@ const QVITTER_USER_TIMELINE_URL = '/api/qvitter/statuses/user_timeline.json'
|
||||||
|
|
||||||
const oldfetch = window.fetch
|
const oldfetch = window.fetch
|
||||||
|
|
||||||
|
import { map } from 'lodash'
|
||||||
|
|
||||||
let fetch = (url, options) => {
|
let fetch = (url, options) => {
|
||||||
const baseUrl = ''
|
const baseUrl = ''
|
||||||
const fullUrl = baseUrl + url
|
const fullUrl = baseUrl + url
|
||||||
|
@ -124,7 +126,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false, use
|
||||||
params.push(['user_id', userId])
|
params.push(['user_id', userId])
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryString = new URLSearchParams(params).toString()
|
const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
|
||||||
url += `?${queryString}`
|
url += `?${queryString}`
|
||||||
|
|
||||||
return fetch(url, { headers: authHeaders(credentials) }).then((data) => data.json())
|
return fetch(url, { headers: authHeaders(credentials) }).then((data) => data.json())
|
||||||
|
|
Loading…
Reference in a new issue