瀏覽代碼

Fix query

The query params get sent to the server as "undefined"
master
TheoryOfNekomata 3 年之前
父節點
當前提交
6ad4ab1b8f
共有 1 個檔案被更改,包括 8 行新增4 行删除
  1. +8
    -4
      packages/app-web/src/pages/index.tsx

+ 8
- 4
packages/app-web/src/pages/index.tsx 查看文件

@@ -82,10 +82,14 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res, query }
}
: null
const client = new RingtoneClient(process.env.NEXT_PUBLIC_API_BASE_URL, session)
const { data: ringtones, skip, take, total } = await client.browse({
skip: query.skip ? Number(query.skip) : undefined,
take: query.take ? Number(query.take) : undefined,
})
const browseParams: { skip: number, take: number } = {} as any
if (query.skip) {
browseParams.skip = Number(query.skip)
}
if (query.skip) {
browseParams.take = Number(query.take)
}
const { data: ringtones, skip, take, total } = await client.browse(browseParams)

return {
props: {


Loading…
取消
儲存