Migrate the rest of the easy stuff
All checks were successful
Test, Build, Deploy / Test, Build, and Deploy (push) Successful in 58s
Test, Build, Deploy / Create Sentry Release (push) Successful in 6s

This commit is contained in:
2026-04-11 04:32:09 -04:00
parent 48631e32be
commit 5c17f87f89
13 changed files with 244 additions and 177 deletions

View File

@@ -1,11 +1,18 @@
import { jsonResponse } from "../../common.js";
export async function onRequestGet(context: RequestContext) {
const { results } = await context.env.D1.prepare(
"SELECT created_at, destination, path FROM short_links WHERE user = ?;",
)
.bind(context.data.current_user.id)
.all();
return jsonResponse(JSON.stringify(results));
return jsonResponse(
JSON.stringify(
await context.data.prisma.shortLink.findMany({
select: {
created_at: true,
destination: true,
path: true,
},
where: {
user: context.data.current_user.id,
},
}),
),
);
}