fetchGiphyGifs = (endpoint) => {
var limit = Math.min(this.gifsToLoad, this.maxGifsToLoad - this.state.offset)
if (this.provider == providers.ALL) {
limit = Math.floor(limit/2)
}
if (endpoint == endpoints.TRENDING) {
return Requests.fetch("GET", GIPHY_BASE_URL + "trending", {
"api_key": this.giphyApiKey,
"limit": limit,
"rating": "pg",
"offset": this.state.offset,
...this.props.giphyApiProps,
})
} else if (endpoint == endpoints.SEARCH) {
return Requests.fetch("GET", GIPHY_BASE_URL + "search", {
"api_key": this.giphyApiKey,
"q": this.state.search_term,
"limit": limit,
"rating": "pg",
"offset": this.state.offset,
...this.props.giphyApiProps,
})
}
}