권주희

add get item api

......@@ -57,8 +57,12 @@ class ItemViewSet(viewsets.ViewSet):
# url: items/11/
# 마지막 slash도 써주어야함
def get(self, request, pk):
print(pk)
return Response({'message': "info complete"}, status=status.HTTP_200_OK)
item = Item.objects.filter(item_id=pk)
data = serializers.serialize("json", item)
json_data = json.loads(data)
res = json_data[0]['fields']
res['id']=json_data[0]['pk']
return Response({'data': res}, status=status.HTTP_200_OK)
# url: items/11/
# 마지막 slash도 써주어야함
......