linter fixes

This commit is contained in:
Gamebrary 2022-03-18 09:32:17 -07:00
parent bbce23063a
commit 384635e156
2 changed files with 5 additions and 6 deletions

View file

@ -63,16 +63,16 @@ exports.customSearch = functions.https.onRequest((req, res) => {
},
data,
})
.then(({ data }) => res.status(200).send(data))
.catch((error) => res.status(400).send(error));
.then(({ data: response }) => res.status(200).send(response))
.catch(error => res.status(400).send(error));
});
exports.search = functions.https.onRequest((req, res) => {
res.set('Access-Control-Allow-Origin', "*")
res.set('Access-Control-Allow-Origin', '*')
const { search, platform, token } = req.query;
const missingFields = [search, token].filter((field) => !field).length > 0;
const missingFields = [search, token].filter(field => !field).length > 0;
if (missingFields) {
return res.status(400).json({ error: 'missing required params (search OR platform OR token)' });
@ -83,7 +83,7 @@ exports.search = functions.https.onRequest((req, res) => {
fields id,name,slug,rating,release_dates.*,name,cover.image_id;
limit 50;
${platform ? `where platforms = (${platform});` : ''}
`
`;
axios({
url: 'https://api.igdb.com/v4/games',

View file

@ -1,5 +1,4 @@
export const POPULAR_PLATFORMS = [169, 167, 130, 48, 49, 41];
export const DEFAULT_LIST_VIEW = 'single';
export const MIN_PROFILE_LENGTH = 6;
export const MAX_PROFILE_LENGTH = 32;