[PATCH 1/3] Adjust API endpoint to reflects the UI endpoints in their url structure
Pierre-Yves Chibon
pingou at pingoured.fr
Fri Sep 27 13:07:35 UTC 2013
---
coprs_frontend/coprs/views/api_ns/api_general.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/coprs_frontend/coprs/views/api_ns/api_general.py b/coprs_frontend/coprs/views/api_ns/api_general.py
index 7130509..205f561 100644
--- a/coprs_frontend/coprs/views/api_ns/api_general.py
+++ b/coprs_frontend/coprs/views/api_ns/api_general.py
@@ -44,9 +44,9 @@ def api_new_token():
return flask.redirect(flask.url_for('api_ns.api_home'))
- at api_ns.route('/copr/new/', methods=['POST'])
+ at api_ns.route('/coprs/<username>/new/', methods=['POST'])
@api_login_required
-def api_new_copr():
+def api_new_copr(username):
""" Receive information from the user on how to create its new copr,
check their validity and create the corresponding copr.
@@ -101,8 +101,8 @@ def api_new_copr():
return jsonout
- at api_ns.route('/owned/')
- at api_ns.route('/owned/<username>/')
+ at api_ns.route('/coprs/')
+ at api_ns.route('/coprs/<username>/')
def api_coprs_by_owner(username=None):
""" Return the list of coprs owned by the given user.
username is taken either from GET params or from the URL itself
@@ -133,8 +133,7 @@ def api_coprs_by_owner(username=None):
return jsonout
- at api_ns.route('/coprs/detail/<username>/<coprname>/new_build/',
- methods=["POST"])
+ at api_ns.route('/coprs/<username>/<coprname>/new_build/', methods=["POST"])
@api_login_required
def copr_new_build(username, coprname):
form = forms.BuildForm(csrf_enabled=False)
--
1.8.3.1
More information about the copr-devel
mailing list