feat: add SoonestStays
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
} from "@/server/errors/trpc"
|
||||
import { protectedProcedure, router } from "@/server/trpc"
|
||||
|
||||
import { staysInput } from "./input"
|
||||
import { soonestUpcomingStaysInput, staysInput } from "./input"
|
||||
import { getUserSchema } from "./output"
|
||||
import {
|
||||
benefits,
|
||||
@@ -85,6 +85,12 @@ export const userQueryRouter = router({
|
||||
}),
|
||||
|
||||
stays: router({
|
||||
soonestUpcoming: protectedProcedure
|
||||
.input(soonestUpcomingStaysInput)
|
||||
.query(async ({ input }) => {
|
||||
return upcomingStays.slice(0, input.limit)
|
||||
}),
|
||||
|
||||
previous: protectedProcedure.input(staysInput).query(async (opts) => {
|
||||
const { perPage, page, cursor } = opts.input
|
||||
let nextCursor: typeof cursor | undefined = undefined
|
||||
|
||||
Reference in New Issue
Block a user