Skip to content

refactor: CCP-5381 clean up store issues - #663

Draft
WalterMoar wants to merge 1 commit into
mainfrom
refactor/5381-cleanup-stores
Draft

refactor: CCP-5381 clean up store issues#663
WalterMoar wants to merge 1 commit into
mainfrom
refactor/5381-cleanup-stores

Conversation

@WalterMoar

@WalterMoar WalterMoar commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

While cleaning up the unit tests for the stores there are many improvement items coming up, including:

  1. Standardize the naming of the response data returned by service calls, like groupApiData
  2. useGroupStore.addGroup calls upsertGroup, but it only ever does an insert
  3. useGroupStore.addGroupUser should do API call and mapping together, then do something with the model object
  4. useGroupStore.removeGroupUser should check that the user is in the group before removing, and throw an error if it doesn’t exist
  5. useGroupStore.updateGroupRoles should be renamed to updateGroupServiceRoles
  6. useGroupStore.updateGroupRoles should update the store with the data returned by the service, not the data from the user
  7. useGroupStore.updateGroupRoles tsdocs say that an error is thrown but this is not true
  8. useGroupStore.updateGroupRoles is peculiar in that it deals with GroupServices but the API is Services
  9. useGroupStore.updateGroupRoles test suite needs to be fixed up, but not too much point until the code is fixed
  10. useServiceStore.addServiceToTenant doesn’t update the store, so fix it and then unskip the test
  11. useServiceStore.createService calls upsertService, but it only ever does an insert
  12. useServiceStore.fetchServices does an upsert of the API data, which does not remove services, so it should just replace the array. Fix it and unskip the test
  13. useTenantRequestStore.updateTenantRequestStatus does not update the name in the store. This bug may be visible to the user
  14. useTenantRequestStore.updateTenantRequestStatus ignores the update if the tenant request id is not found. Is this right?

Type of change

refactor: a code change that neither fixes a bug nor adds a feature

Checklist

  • I have performed a thorough self-review of the changes in this PR
  • The changes are self-explanatory or have comments where needed
  • I have checked that documentation is still accurate after these changes
  • My changes are covered by the existing tests or tests have been added

Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

@sonarqubecloud

Copy link
Copy Markdown

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