Expand fields in igdb search endpoint

This commit is contained in:
Roman Cervantes 2018-11-01 18:41:25 -07:00
parent fe12b0b4f6
commit c8ae6f1aba

View file

@ -10,7 +10,7 @@ exports.search = functions.https.onRequest((req, res) => {
const { searchText, platformId } = req.query;
axios.get(`${igdbUrl}/games/?search=${searchText}&fields=*&filter[platforms][eq]=${platformId}&limit=20&order=popularity:desc`)
axios.get(`${igdbUrl}/games/?search=${searchText}&fields=id,name,slug,created_at,updated_at,summary,rating,category,player_perspectives,release_dates,name,cover,platforms,screenshots,videos,websites,esrb,pegi,themes.name,game.name&expand=game,themes,developers,publishers,game_engines,game_modes,genres,platforms,player_perspectives&filter[platforms][eq]=${platformId}&limit=20&order=popularity:desc`)
.then(({ data }) => { res.status(200).send(data) })
.catch(() => { res.send(400) });
});