Burn it all to the ground and start with bun and a reorg

This commit is contained in:
2025-05-09 17:51:29 +01:00
parent 6eaf1d6b9f
commit 95f317fd75
82 changed files with 3001 additions and 13108 deletions

View File

@@ -0,0 +1,40 @@
import { z } from "zod";
import {
createTRPCRouter,
protectedProcedure,
publicProcedure,
} from "@/server/api/trpc";
import { list } from "./list";
import { update } from "./update";
export const photosRouter = createTRPCRouter({
list: publicProcedure
.input(
z
.object({
limit: z.number().nonnegative().default(1),
cursor: z.number().nonnegative().default(0),
})
.optional()
.default({}),
)
.query(async ({ input }) => {
const ret = await list({
limit: input.limit + 1,
cursor: input.cursor,
});
let next: number | undefined;
if (ret.length > input.limit) {
next = input.limit;
ret.pop();
}
return {
data: ret,
next,
};
}),
update: protectedProcedure.query(update),
});