fix(recipe edit page): 修复创建食材后创建弹窗中文字还在的问题;修改菜谱列表接口按 id 倒序排列
修复创建食材后创建弹窗中文字还在的问题;修改菜谱列表接口按 id 倒序排列 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
e5c79047c9
commit
737f86194f
@ -384,7 +384,9 @@ export default {
|
|||||||
message: '创建成功',
|
message: '创建成功',
|
||||||
forbidClick: true,
|
forbidClick: true,
|
||||||
duration: 800,
|
duration: 800,
|
||||||
})
|
}),
|
||||||
|
(this.ingredient_name = null),
|
||||||
|
(this.ingredient_unit = null)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class RecipeAPI(viewsets.ModelViewSet):
|
|||||||
# authentication.SessionAuthentication,
|
# authentication.SessionAuthentication,
|
||||||
# authentication.BasicAuthentication)
|
# authentication.BasicAuthentication)
|
||||||
# permission_classes = (permissions.IsAuthenticated,)
|
# permission_classes = (permissions.IsAuthenticated,)
|
||||||
queryset = recipe.models.Recipe.objects.all()
|
queryset = recipe.models.Recipe.objects.order_by('-id')
|
||||||
serializer_class = recipe.serializers.RecipeSerializer
|
serializer_class = recipe.serializers.RecipeSerializer
|
||||||
|
|
||||||
def perform_destroy(self, instance):
|
def perform_destroy(self, instance):
|
||||||
@ -54,7 +54,7 @@ class RecipeAPI(viewsets.ModelViewSet):
|
|||||||
return super().perform_update(serializer)
|
return super().perform_update(serializer)
|
||||||
|
|
||||||
def list(self, request, *args, **kwargs):
|
def list(self, request, *args, **kwargs):
|
||||||
self.queryset = recipe.models.Recipe.objects.exclude(status=const.RECIPE_STATUS_DELETED)
|
self.queryset = self.queryset.exclude(status=const.RECIPE_STATUS_DELETED)
|
||||||
return super().list(request, *args, **kwargs)
|
return super().list(request, *args, **kwargs)
|
||||||
|
|
||||||
filterset_fields = {
|
filterset_fields = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user