Skip to content

Resolves issue #1699, Fix registry user lookups by user UUID.#1811

Merged
david-rocca merged 2 commits into
devfrom
dr_1699
May 21, 2026
Merged

Resolves issue #1699, Fix registry user lookups by user UUID.#1811
david-rocca merged 2 commits into
devfrom
dr_1699

Conversation

@david-rocca
Copy link
Copy Markdown
Collaborator

Closes Issue #1699

Summary

Fixes a bug in the registry-user controller where using a user UUID (identifier) for the GET and PUT endpoints failed. The system incorrectly attempted to lookup the user's UUID by passing it as a username, and incorrectly attempted to lookup the user's organization by passing the user's UUID as an Org UUID. The fix properly queries the organization's users array to map the user to their respective organization and updates the user lookup function to search by UUID.

Important Changes

src/repositories/baseOrgRepository.js

  • Added getOrgUUIDByUserUUID to retrieve an organization's UUID by searching for the user's UUID within its users array.
    src/controller/registry-user.controller/registry-user.controller.js
  • getUser: Replaced buggy user and org lookup logic with findUserByUUID and the newly added getOrgUUIDByUserUUID when an identifier is provided.
  • updateUser: Applied the same fix to correctly load the userToEdit and org records, mitigating missing parameter failures.

Testing

Steps to manually test updated functionality, if possible

  • 1) Create a new user (or identify an existing one) to obtain their UUID (identifier).
  • 2) Make a request to GET /api/registryUser/:identifier using the user's UUID and verify it returns a 200 response with correct data.
  • 3) Make a request to PUT /api/registryUser/:identifier using the user's UUID to update a field (e.g., name.first) and confirm the update succeeds.
  • 4) Run the npm run test:integration command to confirm all existing integration tests pass cleanly.

Notes

  • As noted in the codebase, the method getOrgUUIDByUserUUID correctly maps one user to one org. Eventually, when a user can be in more than one org, this approach will need to be revised.

@david-rocca david-rocca merged commit b6ba5c7 into dev May 21, 2026
8 checks passed
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.

2 participants