diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-07-05 07:42:32 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-07-05 07:42:32 +0200 |
commit | 271b47605e2491e65a6d31541a2885df37fe5c31 (patch) | |
tree | 06532b0894458971b6f80d39f0b8a7d19ac3e68e /pyaggr3g470r/rest.py | |
parent | Updated NEWS.rst. (diff) | |
download | newspipe-271b47605e2491e65a6d31541a2885df37fe5c31.tar.gz newspipe-271b47605e2491e65a6d31541a2885df37fe5c31.tar.bz2 newspipe-271b47605e2491e65a6d31541a2885df37fe5c31.zip |
Updated REST API error codes.
Diffstat (limited to 'pyaggr3g470r/rest.py')
-rw-r--r-- | pyaggr3g470r/rest.py | 16 |
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') |