Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix path segment check
  • Loading branch information
regalijan committed Feb 22, 2024
1 parent 202b8aa commit 7a9ea04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/api/events-team/events/[id]/_middleware.ts
Expand Up @@ -4,7 +4,7 @@ export async function onRequest(context: RequestContext) {
const pathSegments = new URL(context.request.url).pathname.split("/");

// Skip checks for the by-id endpoint
if (pathSegments.length > 5) return await context.next();
if (pathSegments.length <= 5) return await context.next();

const eventInfo = await context.env.D1.prepare(
"SELECT * FROM events WHERE id = ?;",
Expand Down

0 comments on commit 7a9ea04

Please sign in to comment.