aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-07-05 07:42:32 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-07-05 07:42:32 +0200
commit271b47605e2491e65a6d31541a2885df37fe5c31 (patch)
tree06532b0894458971b6f80d39f0b8a7d19ac3e68e
parentUpdated NEWS.rst. (diff)
downloadnewspipe-271b47605e2491e65a6d31541a2885df37fe5c31.tar.gz
newspipe-271b47605e2491e65a6d31541a2885df37fe5c31.tar.bz2
newspipe-271b47605e2491e65a6d31541a2885df37fe5c31.zip
Updated REST API error codes.
-rw-r--r--pyaggr3g470r/rest.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/pyaggr3g470r/rest.py b/pyaggr3g470r/rest.py
index 5732ce02..d9188c78 100644
--- a/pyaggr3g470r/rest.py
+++ b/pyaggr3g470r/rest.py
@@ -206,8 +206,8 @@ class ArticleAPI(Resource):
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):
@@ -220,8 +220,8 @@ class ArticleAPI(Resource):
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')
@@ -338,8 +338,8 @@ class FeedAPI(Resource):
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):
@@ -352,8 +352,8 @@ class FeedAPI(Resource):
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')
bgstack15