Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Nov 12, 2025

  • Refactor event page routing to include company slug in URLs
  • Update event edit page to handle API response changes
  • Modify event links to use dynamic company slug
  • Adjust event fetching and error handling in edit page
  • Update dashboard event statistics to filter by approved events
  • Fix potential routing issues with event management pages

Summary by CodeRabbit

  • Updates
    • Dashboard event statistics now display the count of approved events instead of total events.
    • Event editing and navigation paths have been reorganized for improved URL structure and company-event relationship organization.

- Refactor event page routing to include company slug in URLs
- Update event edit page to handle API response changes
- Modify event links to use dynamic company slug
- Adjust event fetching and error handling in edit page
- Update dashboard event statistics to filter by approved events
- Fix potential routing issues with event management pages
@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Nov 12, 2025 11:56am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Route parameter structure refined across event management pages, separating company slug from event slug for nested routing. Event listing links updated to reflect new path structure. Dashboard event statistics calculation switched from static company data to dynamically filtered approved events collection.

Changes

Cohort / File(s) Change Summary
Event edit page route refactoring
app/dashboard/company/[slug]/events/[eventSlug]/edit/page.tsx
Separated route parameters into distinct companySlug (from slug) and eventSlug. Updated API fetch to use eventSlug, adjusted response handling, and updated all redirects, error navigation, and useEffect dependencies to use both parameters.
Event listing link updates
app/dashboard/company/[slug]/events/page.tsx, app/dashboard/company/events/page.tsx
Updated edit action links to include company slug in nested path structure: changed from /dashboard/company/events/${event.slug}/edit to /dashboard/company/${currentCompany.slug}/events/${event.slug}/edit (two occurrences per file).
Dashboard event stats calculation
components/dashboard/CompanyDashboard.tsx
Introduced approvedEvents collection by filtering eventsData.events for approval_status === 'approved'. Updated totalEvents stat to use approvedEvents.length instead of static company.total_events.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • File-specific attention points:
    • Verify all API calls in the edit page use eventSlug consistently and API responses match expected structure
    • Confirm redirect paths correctly compose company and event slugs to prevent routing errors
    • Validate that the approvedEvents filtering logic correctly identifies approved events and that dependencies are accurate
    • Cross-check that all three pages' edit links point to the correct nested route structure

Poem

🐰 Routes refined with clearer path,
Company and event, a routing math!
Slugs now nested, filtering true,
Dashboard stats see approved through! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/multicompanylevel

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5495e28 and 60f4e70.

📒 Files selected for processing (4)
  • app/dashboard/company/[slug]/events/[eventSlug]/edit/page.tsx (6 hunks)
  • app/dashboard/company/[slug]/events/page.tsx (1 hunks)
  • app/dashboard/company/events/page.tsx (1 hunks)
  • components/dashboard/CompanyDashboard.tsx (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants