Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Pull Request Merged

PR #118 merged: fix: use uid for all admin user links

Summary

Three admin screens still linked to users by numeric ID instead of UID, causing 404s due to the HasUid Sqid route binding.

Root fix

Added uid to User model's $appends array so it's always included when User is serialized to JSON. This means any controller that passes a User relation (via eager loading, Inertia serialization, etc.) automatically gets uid — no more per-controller manual additions needed.

Screens fixed

  • Admin Dashboard — recent registrations "View user" links
  • Verification Detail — "View Profile" link to user
  • Support Request Detail — "View profile" link to user

Why this keeps happening

The HasUid trait overrides resolveRouteBindingQuery to always Sqid-decode the route value. Passing a raw numeric ID like /admin/users/42 gets decoded to a wrong ID or null. Every link to a User route must use user.uid, not user.id.

Test plan

  • 1035 tests pass
  • Build clean
  • Grep confirms zero remaining admin/users/${...id} patterns
  • QA: dashboard → click user → loads
  • QA: verifications → click "View Profile" → loads
  • QA: support → click "View profile" → loads
+19
additions
-6
deletions
6
files changed