fix: 修复NodeChildrenAddAPI不支持patch方法的问题

pull/5887/head
Bai 2021-04-01 10:36:18 +08:00 committed by Jiangjie.Bai
parent 06ed358fbc
commit 2ff01a4bb3
1 changed files with 2 additions and 1 deletions

View File

@ -221,7 +221,8 @@ class NodeAddChildrenApi(generics.UpdateAPIView):
serializer_class = serializers.NodeAddChildrenSerializer
instance = None
def put(self, request, *args, **kwargs):
def update(self, request, *args, **kwargs):
""" 同时支持 put 和 patch 方法"""
instance = self.get_object()
node_ids = request.data.get("nodes")
children = Node.objects.filter(id__in=node_ids)