This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
fix(api): Removing host type AND having the cursor in the search bar sends an error 500 #8432
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.
Description
when the user sends invalid regexp to with operator $rg server will throw an exception from the DB,
the idea is to change the REGEXP with LIKE when the syntax is not valid
Fixes MON-5034
Type of change
Target serie
How this pull request can be tested ?
send GET request to http://localhost/centreon/api/beta/monitoring/resources?page=1&limit=100&search={%22$or%22:[{%22name%22:{%22$rg%22:%22a%22}}]}
Checklist
Community contributors & Centreon team
Centreon team only