You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have looked into this and agree that merging the filter and search functionalities makes sense. It seems unnecessary to have a separate search endpoint, especially when the search is intended specifically for licenses. Below are the two approaches via which this can be implemented-
In the initial approach, we can eliminate the /search endpoint entirely and incorporate search functionality within the FilterLicense handler for the /licenses endpoint. We will manage both GET and POST requests concurrently, and depending on the request method, we will direct the code flow to either the search functionality or the filter functionality.
Another approach involves redefining the search functionality. Currently, it requires a POST request, validates the request body with the model, and queries the database to provide results. Instead, this can be migrated to use query parameters. By doing so, we can integrate the search functionality into the FilterLicense endpoint without changing the request method. The code flow can then be determined by the presence of specific parameters, allowing redirection to either search or filter based on the client's input.
Additionally, with this migration, the swagger documentation and tests in api_test.go will need to be updated.
If this issue is scheduled for development, I will create a PR. I require your input on the approach to use or any better suggestions.
api/licenses
api/licenses/search
The purpose is to create an API that can merge the results of filter and search API.
The text was updated successfully, but these errors were encountered: