1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 01:48:12 +09:00

fix: limit 10 items

This commit is contained in:
2019-08-07 14:08:45 +09:00
parent 1031a70b0f
commit d480d14100
3 changed files with 33 additions and 24 deletions

View File

@@ -8,12 +8,12 @@ module.exports = async (req, res) => {
}
const term = encodeURIComponent(query)
// const country = 'us'
const limit = 3
const countryCode = country || 'us'
const limit = 10
try {
const response = await fetch(
`https://itunes.apple.com/search?media=software&entity=software,iPadSoftware,macSoftware&country=${country}&limit=${limit}&term=${term}`,
`https://itunes.apple.com/search?media=software&entity=software,iPadSoftware,macSoftware&country=${countryCode}&limit=${limit}&term=${term}`,
'GET'
)
const body = await response.json()