More events team nonsense
This commit is contained in:
@@ -6,12 +6,11 @@ export async function onRequest(context: RequestContext) {
|
||||
// Skip checks for the by-id endpoint
|
||||
if (pathSegments.length <= 5) return await context.next();
|
||||
|
||||
const eventInfo = await context.env.D1.prepare(
|
||||
"SELECT * FROM events WHERE id = ?;",
|
||||
)
|
||||
.bind(context.params.id)
|
||||
.first();
|
||||
|
||||
const eventInfo = await context.data.prisma.event.findUnique({
|
||||
where: {
|
||||
id: context.params.id as string,
|
||||
},
|
||||
});
|
||||
if (!eventInfo) return jsonError("This event does not exist.", 404);
|
||||
|
||||
if (![1 << 4, 1 << 12].find((p) => context.data.current_user.permissions & p))
|
||||
|
||||
Reference in New Issue
Block a user