Example #1
0
 def get(self):
     user_id = get_jwt_identity()
     children = [child.json() for child in ChildModel.find_all()]
     if user_id:
         return {'children': children}, 200
     return {
         'message': 'no data available unless you log in.',
         'error': 'token expired'
             }, 401
Example #2
0
 def get():
     children = ChildModel.find_all()
     return children, 200