|
@@ -82,10 +82,14 @@ export const getServerSideProps: GetServerSideProps = async ({ req, res, query } |
|
|
} |
|
|
} |
|
|
: null |
|
|
: null |
|
|
const client = new RingtoneClient(process.env.NEXT_PUBLIC_API_BASE_URL, session) |
|
|
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 { |
|
|
return { |
|
|
props: { |
|
|
props: { |
|
|