Unverified Commit d38ed7bd authored by jinjie's avatar jinjie Committed by GitHub

fix: page start index should be 0 (#137)

parent a174afcb
...@@ -16,7 +16,7 @@ async function fetchFeed (feed: keyof typeof feedsInfo, page = '1') { ...@@ -16,7 +16,7 @@ async function fetchFeed (feed: keyof typeof feedsInfo, page = '1') {
const { fetchItem } = await import('./item.get') const { fetchItem } = await import('./item.get')
const entries = Object.values( const entries = Object.values(
await $fetch(`${baseURL}/${feedUrls[feed]}.json`) await $fetch(`${baseURL}/${feedUrls[feed]}.json`)
).slice(Number(page) * 10, Number(page) * 10 + 10) as string[] ).slice((Number(page) - 1) * 10, Number(page) * 10) as string[]
return Promise.all(entries.map(id => fetchItem(id))) return Promise.all(entries.map(id => fetchItem(id)))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment