mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	Sort search fields (#10095)
* Sort search fields * add api version bump --------- Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
		| @@ -1,11 +1,14 @@ | ||||
| """InvenTree API version information.""" | ||||
|  | ||||
| # InvenTree API version | ||||
| INVENTREE_API_VERSION = 374 | ||||
| INVENTREE_API_VERSION = 375 | ||||
|  | ||||
| """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" | ||||
|  | ||||
| INVENTREE_API_TEXT = """ | ||||
| v375 -> 2025-07-28 : https://github.com/inventree/InvenTree/pull/10095 | ||||
|     - Sorts searched fields to keep API stable | ||||
|  | ||||
| v374 -> 2025-07-28 : https://github.com/inventree/InvenTree/pull/10092 | ||||
|     - Add nullable to a few details fields that lack it | ||||
|     - Add the list of searched fields to the search parameter comments | ||||
|   | ||||
| @@ -105,7 +105,11 @@ class ExtendedAutoSchema(AutoSchema): | ||||
|  | ||||
|         # Add valid search fields to the search description. | ||||
|         search_fields = getattr(self.view, 'search_fields', None) | ||||
|  | ||||
|         if search_fields is not None: | ||||
|             # Ensure consistent ordering of search fields | ||||
|             search_fields = sorted(search_fields) | ||||
|  | ||||
|             parameters = operation.get('parameters', []) | ||||
|             for parameter in parameters: | ||||
|                 if parameter['name'] == 'search': | ||||
|   | ||||
		Reference in New Issue
	
	Block a user