Skip to content

Commit

Permalink
Merge pull request #15 from flolep2607/patch-1
Browse files Browse the repository at this point in the history
remove the type bug
  • Loading branch information
hansputera authored Jan 12, 2022
2 parents fee31d6 + 319c274 commit 7e7ed99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default async (req: VercelRequest, res: VercelResponse) => {
ow.optional.boolean : ow.optional.string,
}));

const provider = getProvider((req.query.type || req.body.type) ?? 'random');
const provider = getProvider((req.query && req.query.type || req.body && req.body.type) ?? 'random');
if (!provider) {
return res.status(400).json({
'error': 'Invalid provider',
Expand Down

0 comments on commit 7e7ed99

Please sign in to comment.