fix: pagination for stays
This commit is contained in:
@@ -2,7 +2,7 @@ import { z } from "zod"
|
|||||||
|
|
||||||
export const staysInput = z
|
export const staysInput = z
|
||||||
.object({
|
.object({
|
||||||
cursor: z.string().optional(),
|
cursor: z.number().optional(),
|
||||||
limit: z.number().min(0).default(6),
|
limit: z.number().min(0).default(6),
|
||||||
})
|
})
|
||||||
.default({})
|
.default({})
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export const userQueryRouter = router({
|
|||||||
params.set("limit", limit.toString())
|
params.set("limit", limit.toString())
|
||||||
|
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
params.set("offset", cursor)
|
params.set("offset", cursor.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiResponse = await api.get(
|
const apiResponse = await api.get(
|
||||||
@@ -148,7 +148,7 @@ export const userQueryRouter = router({
|
|||||||
params.set("limit", limit.toString())
|
params.set("limit", limit.toString())
|
||||||
|
|
||||||
if (cursor) {
|
if (cursor) {
|
||||||
params.set("offset", cursor)
|
params.set("offset", cursor.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiResponse = await api.get(
|
const apiResponse = await api.get(
|
||||||
|
|||||||
Reference in New Issue
Block a user