mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-16 01:36:29 +00:00
Make the part thumbnail selection window searchable
This commit is contained in:
@@ -338,9 +338,7 @@ class PartThumbs(generics.ListAPIView):
|
||||
- Images may be used for multiple parts!
|
||||
"""
|
||||
|
||||
queryset = self.get_queryset()
|
||||
|
||||
# TODO - We should return the thumbnails here, not the full image!
|
||||
queryset = self.filter_queryset(self.get_queryset())
|
||||
|
||||
# Return the most popular parts first
|
||||
data = queryset.values(
|
||||
@@ -349,6 +347,18 @@ class PartThumbs(generics.ListAPIView):
|
||||
|
||||
return Response(data)
|
||||
|
||||
filter_backends = [
|
||||
filters.SearchFilter,
|
||||
]
|
||||
|
||||
search_fields = [
|
||||
'name',
|
||||
'description',
|
||||
'IPN',
|
||||
'revision',
|
||||
'keywords',
|
||||
'category__name',
|
||||
]
|
||||
|
||||
class PartThumbsUpdate(generics.RetrieveUpdateAPIView):
|
||||
""" API endpoint for updating Part thumbnails"""
|
||||
|
Reference in New Issue
Block a user