Fix remove user selection is using the wrong api#9280
Merged
PascalLike merged 1 commit intoMay 18, 2026
Conversation
ianwallen
approved these changes
May 16, 2026
tanzeeladebont
approved these changes
May 18, 2026
fxprunayre
pushed a commit
to SPW-DIG/metawal-core-geonetwork
that referenced
this pull request
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following #9273 there are still issues with the user selection caused by #8864
When we try to remove a user selection from the UI, the deleteUserSelection endpoint is called instead of deleteUserSelectionRecords.
This endpoint is restricted to UserAdmin, so nothing happens when non-admin users try to remove a selection.
When a UserAdmin or higher removes a selection, the endpoint is called successfully. However, this endpoint removes all records for all users for that selection type, and then removes the selection type from the database.
For example, if an admin adds two records to their watchlist and then removes one, the entire watchlist selection is removed for all users. The watchlist type itself no longer exists, so the next time anyone tries to add something to their watchlist, the option is no longer available.

This PR aims to fix this issue by calling deleteUserSelectionRecords when removing a selection from the UI, so only the selected record is removed from the current user's selection.
Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation