remove collect

This commit is contained in:
caoqianming 2020-03-24 11:35:27 +08:00
parent 1a5ce792fe
commit 284100841d
3 changed files with 5 additions and 5 deletions

View File

@ -48,9 +48,9 @@ App({
globalData: {
userInfo: null,
userinfo: null, // 服务器传回的消费者信息
host: 'https://apitest.ctcshe.com/api/',
// host: 'https://apitest.ctcshe.com/',
mediahost: 'https://apitest.ctcshe.com/',
// host: 'http://127.0.0.1:8000/api/',
host: 'http://127.0.0.1:8000/',
// mediahost: 'http://127.0.0.1:8000/',
token : '',
subject:null,

View File

@ -22,7 +22,7 @@
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "刷题",
"navigationBarTitleText": "中科辐射学堂",
"navigationBarTextStyle": "black"
},
"tabBar": {

View File

@ -132,7 +132,7 @@ class ConsumerViewSet(ModelViewSet):
else:
return Response({'error':result['data']})
@action(methods=['post','delete', 'get'], detail=False, permission_classes=[], authentication_classes=[ConsumerTokenAuthentication],
@action(methods=['post','delete','get'], detail=False, permission_classes=[], authentication_classes=[ConsumerTokenAuthentication],
url_path='collects', url_name='create_collects')
def collects(self, request):
'''
@ -150,7 +150,7 @@ class ConsumerViewSet(ModelViewSet):
queryset = request.user.collects.all().order_by('-update_time')
serializer = QuestionSerializer(instance=queryset,many=True)
return Response(serializer.data)
else:
elif request.method == 'DELETE':
questionId = request.data.get('question',None)
if questionId:
request.user.collects.remove(questionId)