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):
|
class SupermarketViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
||||||
|
schema = FilterSchema()
|
||||||
queryset = Supermarket.objects
|
queryset = Supermarket.objects
|
||||||
serializer_class = SupermarketSerializer
|
serializer_class = SupermarketSerializer
|
||||||
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
||||||
@ -1172,7 +1173,6 @@ class ShoppingListEntryViewSet(viewsets.ModelViewSet):
|
|||||||
try:
|
try:
|
||||||
last_autosync = self.request.query_params.get('last_autosync', None)
|
last_autosync = self.request.query_params.get('last_autosync', None)
|
||||||
if last_autosync:
|
if last_autosync:
|
||||||
|
|
||||||
last_autosync = datetime.datetime.fromtimestamp(int(last_autosync) / 1000, datetime.timezone.utc)
|
last_autosync = datetime.datetime.fromtimestamp(int(last_autosync) / 1000, datetime.timezone.utc)
|
||||||
self.queryset = self.queryset.filter(updated_at__gte=last_autosync)
|
self.queryset = self.queryset.filter(updated_at__gte=last_autosync)
|
||||||
except:
|
except:
|
||||||
@ -1202,6 +1202,7 @@ class ShoppingListEntryViewSet(viewsets.ModelViewSet):
|
|||||||
else:
|
else:
|
||||||
return Response(serializer.errors, 400)
|
return Response(serializer.errors, 400)
|
||||||
|
|
||||||
|
|
||||||
# TODO deprecate
|
# TODO deprecate
|
||||||
class ShoppingListViewSet(viewsets.ModelViewSet):
|
class ShoppingListViewSet(viewsets.ModelViewSet):
|
||||||
queryset = ShoppingList.objects
|
queryset = ShoppingList.objects
|
||||||
@ -1284,6 +1285,7 @@ class BookmarkletImportViewSet(viewsets.ModelViewSet):
|
|||||||
|
|
||||||
|
|
||||||
class UserFileViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
class UserFileViewSet(viewsets.ModelViewSet, StandardFilterMixin):
|
||||||
|
schema = FilterSchema()
|
||||||
queryset = UserFile.objects
|
queryset = UserFile.objects
|
||||||
serializer_class = UserFileSerializer
|
serializer_class = UserFileSerializer
|
||||||
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
permission_classes = [CustomIsUser & CustomTokenHasReadWriteScope]
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -393,7 +393,7 @@ export const ApiMixin = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
genericAPI: function (model, action, options) {
|
||||||
let setup = getConfig(model, action)
|
let setup = getConfig(model, action)
|
||||||
if (setup?.config?.function) {
|
if (setup?.config?.function) {
|
||||||
|
Loading…
Reference in New Issue
Block a user