More stuff to migrate
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user