diff --git a/src/server/api/routes/share/delete.ts b/src/server/api/routes/share/delete.ts index 3880c7036..b400e9e5e 100644 --- a/src/server/api/routes/share/delete.ts +++ b/src/server/api/routes/share/delete.ts @@ -31,7 +31,7 @@ const ResponseSchema = z.object({ }), }); -export const _delete = withAuthApiV1 +export const deleteOne = withAuthApiV1 .createRoute({ method: "delete", path: "/v1/{companyId}/shares/{id}", diff --git a/src/server/api/routes/share/getMany.ts b/src/server/api/routes/share/getMany.ts index 9b1003b44..bccf919e7 100644 --- a/src/server/api/routes/share/getMany.ts +++ b/src/server/api/routes/share/getMany.ts @@ -57,6 +57,12 @@ export const getMany = withAuthApiV1 .withCursor({ limit: query.limit, after: query.cursor, + getCursor({ id }) { + return id; + }, + parseCursor(cursor) { + return { id: cursor }; + }, }); const response: z.infer = { diff --git a/src/server/api/routes/share/index.ts b/src/server/api/routes/share/index.ts index 96bed96d2..2d1ceb151 100644 --- a/src/server/api/routes/share/index.ts +++ b/src/server/api/routes/share/index.ts @@ -1,12 +1,12 @@ import type { PublicAPI } from "@/server/api/hono"; import { create } from "./create"; -import { _delete } from "./delete"; +import { deleteOne } from "./delete"; import { getMany } from "./getMany"; import { getOne } from "./getOne"; import { update } from "./update"; export const registerShareRoutes = (api: PublicAPI) => { - api.openapi(_delete.route, _delete.handler); + api.openapi(deleteOne.route, deleteOne.handler); api.openapi(getOne.route, getOne.handler); api.openapi(getMany.route, getMany.handler); api.openapi(create.route, create.handler);