def get(self): user_id = get_jwt_identity() print(user_id) if user_id: return {"items": [item.json for item in ItemModel.find_all()]}, 200 return { "items": [item.name for item in ItemModel.find_all()], "message": "Login, to see full response" }, 200
def get(): return {'items': [x.json() for x in ItemModel.find_all()]}