Commit 54dc4c7b authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'test'

modify tag filter create support batch modify tag filter delete to batch

See merge request !197
parents db4f5139 9ac79451
......@@ -167,8 +167,12 @@ class TagFilterList(APIView):
class TagFilterCreate(APIView):
def post(self, request):
tag_name = request.POST.get('tag_name', None)
tag_id = request.POST.get('tag_id', None)
tag_infos = json.loads(request.POST.get('tag_infos', '[]'))
if not tag_infos:
return {'message': '参数不完整'}
for tag_info in tag_infos:
tag_name = tag_info.get('tag_name', None)
tag_id = tag_info.get('tag_id', None)
if not tag_id or not tag_name:
return {'message': '参数不完整'}
......@@ -182,11 +186,12 @@ class TagFilterCreate(APIView):
class TagFilterDelete(APIView):
def post(self, request):
id_ = request.POST.get('id', None)
if not id_:
ids = json.loads(request.POST.get('ids', '[]'))
if not ids:
return {'message': '参数不完整'}
for id_ in ids:
data = self.rpc['venus/sun/tag/filter/delete'](id_=id_).unwrap()
if not data:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment