Files
car-crushers-portal/functions/api/me/reports.ts
2026-04-11 04:29:04 -04:00

23 lines
494 B
TypeScript

import { jsonResponse } from "../../common.js";
export async function onRequestGet(context: RequestContext) {
return jsonResponse(
JSON.stringify(
await context.data.prisma.report.findMany({
select: {
created_at: true,
id: true,
open: true,
target_usernames: true,
},
where: {
user: {
path: "id",
equals: context.data.current_user.id,
},
},
}),
),
);
}