Commits

Cédric Bonhomme committed 271b476

Updated REST API error codes.

  • Participants
  • Parent commits 294aa1c

Comments (0)

Files changed (1)

pyaggr3g470r/rest.py

 
             return {"message":"ok"}
         else:
-            response = jsonify({'code': 404, 'message': 'Article not found'})
-            response.status_code = 404
+            response = jsonify({'message': 'Article not found'})
+            response.status_code = 200
             return response
 
     def delete(self, id):
             db.session.commit()
             return {"message":"ok"}
         else:
-            response = jsonify({'code': 404, 'message': 'Article not found'})
-            response.status_code = 404
+            response = jsonify({'message': 'Article not found'})
+            response.status_code = 200
             return response
 
 api.add_resource(ArticleListAPI, '/api/v1.0/articles', endpoint = 'articles.json')
             db.session.commit()
             return {"message":"ok"}
         else:
-            response = jsonify({'code': 404, 'message': 'Feed not found'})
-            response.status_code = 404
+            response = jsonify({'message': 'Feed not found'})
+            response.status_code = 200
             return response
 
     def delete(self, id):
             db.session.commit()
             return {"message":"ok"}
         else:
-            response = jsonify({'code': 404, 'message': 'Feed not found'})
-            response.status_code = 404
+            response = jsonify({'message': 'Feed not found'})
+            response.status_code = 200
             return response
 
 api.add_resource(FeedListAPI, '/api/v1.0/feeds', endpoint = 'feeds.json')