Skip to content

fix(events): add missing organizerId to response and fix incomplete test mocks causing 500 crashes#609

Closed
yachikadev wants to merge 3 commits into
Dev-Card:mainfrom
yachikadev:fix/event-test-mocks
Closed

fix(events): add missing organizerId to response and fix incomplete test mocks causing 500 crashes#609
yachikadev wants to merge 3 commits into
Dev-Card:mainfrom
yachikadev:fix/event-test-mocks

Conversation

@yachikadev

Copy link
Copy Markdown
Contributor

Summary

Fixes two pre-existing bugs found while working on #554.
Confirmed via git stash that both issues predate any auth-cleanup changes.

Changes

  • event.ts — added missing organizerId to GET /api/events/:slug response
  • event.test.ts — fixed incomplete mocks:
    • Added organizer: { username, displayName } to slug route mocks
    • Added _count: { attendees: N } to attendees route mocks (was causing 500 crashes in 6 tests)

Test Results

  • tsc --noEmit — 0 errors
  • eslint — 0 errors, 0 warnings
  • Tests — 69/69 passed

Closes #606

…Handler

- Remove (app as any).authenticate fallback chains in cards.ts, connect.ts, event.ts, nfc.ts
- Use preHandler: [(req, reply) => app.authenticate(req, reply)] consistently
- Fix TS generic types on route methods to resolve tsc errors

Closes Dev-Card#554
…e and fix incomplete test mocks

- Add organizerId field to EventDetails type and response object in event.ts
- Uncomment organizerId assertion in event.test.ts
- Add organizer object to GET /api/events/:slug mocks
- Add _count object to GET /api/events/:slug/attendees mocks (was causing 500 crashes in 6 tests)

Closes Dev-Card#606
@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@yachikadev is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Hi @yachikadev,

Thanks for opening this pull request.

This PR has been automatically classified based on the files modified.

Applied Labels

  • gssoc:approved
  • backend

Primary Review Area

  • backend

Reviewer

@Harxhit has been identified as the primary reviewer for this pull request.

If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer.

Thank you for your contribution!

@github-actions github-actions Bot added backend gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. labels Jun 19, 2026
Signed-off-by: Yachika Sharma <shakuntalaramphalsharma@gmail.com>
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

CI — Checks Failed

Backend — FAIL

Check Result
Lint FAIL
Test PASS
Typecheck FAIL

Mobile — SKIP

Check Result
Lint -
Test -

Web — SKIP

Check Result
Build -

Last updated: Fri, 19 Jun 2026 09:57:01 GMT

@yachikadev

yachikadev commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

ing some git issues with this PR, closing and reopening a fresh one #632

@yachikadev yachikadev closed this Jun 21, 2026
@yachikadev yachikadev deleted the fix/event-test-mocks branch June 21, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(events): GET /api/events/:slug missing organizerId + incomplete test mocks causing 500s

1 participant