Skip to content

Erorr fix: Add Ticker and Display error. - #6

Merged
CNPJB merged 1 commit into
developfrom
bugfix/addticketfailed
Apr 23, 2026
Merged

Erorr fix: Add Ticker and Display error.#6
CNPJB merged 1 commit into
developfrom
bugfix/addticketfailed

Conversation

@CNPJB

@CNPJB CNPJB commented Apr 23, 2026

Copy link
Copy Markdown
Owner

Erorr fix: Add Ticker and Display error.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed avatar fallback path resolution in user interface
    • Improved ticket detail page stability when floor or room information is unavailable
    • Enhanced cookie security handling for production environments
  • Style

    • Clarified login page text for better user guidance

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR refactors routing from /Ticketproblem to /ticketDetail, transitions API endpoints from hardcoded localhost URLs to environment-based configuration, removes the prismaControllers.js module while updating imports to prismaClient.js, adds optional chaining for null safety in components, updates authentication cookie handling with environment-specific security settings, and imports authentication middleware to route files.

Changes

Cohort / File(s) Summary
Route Configuration
client/src/App.jsx, client/src/components/CardFinishProblem.jsx
Unified route path refactoring from /Ticketproblem to /ticketDetail across route definition and navigation handlers; query parameter ticketId preserved.
API Endpoint Migration
client/src/main.jsx, client/src/hooks/useTickets.js, client/src/pages/Login.jsx
Switched API base URL and endpoint calls from hardcoded localhost (http://localhost:3000) to relative endpoints and environment variable (import.meta.env.VITE_SERVER_URL).
Component Robustness
client/src/pages/DetailTicket.jsx, client/src/components/Navbar.jsx
Added optional chaining for ticket.floor and ticket.room with fallback defaults; updated avatar fallback from relative to absolute root-relative path (/default-avatar.png).
Prisma Client Restructuring
server/config/prismaControllers.js (removed), server/controllers/managementControllers.js, server/controllers/ticketControllers.js
Deleted prismaControllers.js module; updated all controller imports from ../config/prismaControllers.js to ../config/prismaClient.js.
Authentication & Security
server/controllers/authController.js
Modified logout cookie clearing to apply environment-specific settings: production uses secure: true and sameSite: 'none', non-production uses sameSite: 'lax'.
Routing & Middleware Setup
server/routes/managementRoutes.js, server/routes/ticketRoutes.js, server/src/index.js
Added auth middleware imports (verifyToken, requireAdmin) to route files without yet applying them; removed GET /api/gettickets and PUT /api/updateTicket endpoints; reorganized route registration sequence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Feature/login google o auth2.0 #4: Overlapping changes to authentication controllers, routes, and middleware imports alongside Prisma client setup modifications and client-side auth integration.
  • Develop #1: Direct relationship through Prisma client initialization—this PR removes prismaControllers.js while that PR establishes the prismaClient.js configuration with pg Pool adapter.
  • Feature/navbar add tickets #5: Directly connected through client-side routing and navigation changes; both modify DetailTicket, CardFinishProblem, and related ticket detail page flows.

Poem

🐰 Hoppy routes now dance with grace,
From hardcoded paths we embrace,
Environment whispers secrets true,
Prisma's client shiny and new,
Cookies secure in their new home! 🍪

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title is vague and does not accurately summarize the changeset. It contains a typo ('Erorr' instead of 'Error') and 'Add Ticker' is unclear—the changes actually involve refactoring to use environment variables, fixing null-safety issues, and restructuring Prisma configuration, not simply 'adding ticker' functionality. Revise the title to clearly describe the main changes, such as 'Refactor environment configuration and fix null-safety in ticket handling' or similar, and fix the typo.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/addticketfailed

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.

@CNPJB
CNPJB merged commit 605afce into develop Apr 23, 2026
1 check was pending
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.

1 participant