fixed search on userfile and supermarket generic select
This commit is contained in:
parent
f7b25c9b31
commit
bb1b1a40b6
@ -482,6 +482,7 @@ class SyncLogViewSet(viewsets.ReadOnlyModelViewSet):
|
||||
|
||||
|
||||
class SupermarketViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
||||
schema = FilterSchema()
|
||||
queryset = Supermarket.objects
|
||||
serializer_class = SupermarketSerializer
|
||||
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
||||
@ -1172,7 +1173,6 @@ class ShoppingListEntryViewSet(viewsets.ModelViewSet):
|
||||
try:
|
||||
last_autosync = self.request.query_params.get('last_autosync', None)
|
||||
if last_autosync:
|
||||
|
||||
last_autosync = datetime.datetime.fromtimestamp(int(last_autosync) / 1000, datetime.timezone.utc)
|
||||
self.queryset = self.queryset.filter(updated_at__gte=last_autosync)
|
||||
except:
|
||||
@ -1202,6 +1202,7 @@ class ShoppingListEntryViewSet(viewsets.ModelViewSet):
|
||||
else:
|
||||
return Response(serializer.errors, 400)
|
||||
|
||||
|
||||
# TODO deprecate
|
||||
class ShoppingListViewSet(viewsets.ModelViewSet):
|
||||
queryset = ShoppingList.objects
|
||||
@ -1284,6 +1285,7 @@ class BookmarkletImportViewSet(viewsets.ModelViewSet):
|
||||
|
||||
|
||||
class UserFileViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
||||
schema = FilterSchema()
|
||||
queryset = UserFile.objects
|
||||
serializer_class = UserFileSerializer
|
||||
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -393,7 +393,7 @@ export const ApiMixin = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// if passing parameters that are not part of the offical schema of the endpoint use parameter: options: {query: {simple: 1}}
|
||||
// if passing parameters that are not part of the official schema of the endpoint use parameter: options: {query: {simple: 1}}
|
||||
genericAPI: function (model, action, options) {
|
||||
let setup = getConfig(model, action)
|
||||
if (setup?.config?.function) {
|
||||
|
Loading…
Reference in New Issue
Block a user