Ealanisln / ready-set

On-demand courier that specializes in delivery for all your needs. We are Food Safety, and HIPPA Certified. Our team can meet all your Bay Area delivery needs.
https://readysetllc.com
MIT License
0 stars 0 forks source link

User name Navbar #3

Closed Ealanisln closed 1 week ago

Ealanisln commented 1 week ago

The user name into the Navbar sometimes is not showing the correct value from the Database, this due we have two kinds of names values depending if it's driver or client and vendor.

Ealanisln commented 1 week ago

Issue: Admin menu not rendering for super_admin user type

Problem:

The admin menu is not being displayed for users with the "super_admin" type. This is due to an incorrect condition in the menu rendering logic and potentially inconsistent user type naming.

Current code:

...(userType === "admin" && "super_admin" ? [adminMenuItem] : []),

Root causes:

The condition for rendering the admin menu is incorrectly using AND (&&) instead of OR (||). The condition doesn't account for the "super_admin" type explicitly. Possible inconsistency between the user type in the session data and the types checked in the code.

Solution: Update the menu rendering logic to correctly handle both "admin" and "super_admin" user types:

...(userType === "admin" || userType === "super_admin" ? [adminMenuItem] : []),