More stuff to migrate

This commit is contained in:
2026-04-11 04:28:45 -04:00
parent 4860288d11
commit 7b72f815b0
3 changed files with 54 additions and 49 deletions

View File

@@ -40,13 +40,15 @@ export async function loader({ context }: { context: RequestContext }) {
status: 403,
});
const { results } = await context.env.D1.prepare(
"SELECT destination, path FROM short_links WHERE user = ?;",
)
.bind(userId)
.all();
return results as Record<string, string>[];
return await context.data.prisma.shortLink.findMany({
select: {
destination: true,
path: true,
},
where: {
user: userId,
},
});
}
export default function () {