Commit 5d661d79 authored by Jean-Marc Le Roux's avatar Jean-Marc Le Roux

Start using merge requests instead of branches for the amendment API.

parent ceed94aa
......@@ -191,13 +191,11 @@ app.put('/api/v1/project/:project_id/:amendment/:file_path', proxy('localhost:80
* "developers_can_merge": false
* }
*/
app.post('/api/v1/project/:project_id/amendment/:amendment', proxy('localhost:8000', {
app.post('/api/v1/project/:project_id/amendment/:amendment_name', proxy('localhost:8000', {
proxyReqOptDecorator: proxyAuthorizationHeader,
proxyReqPathResolver: (req) => {
return '/admin/api/v4/projects/' + req.params.project_id
+ '/repository/branches'
+ '?ref=master'
+ '&branch=' + querystring.escape(req.params.branch);
+ '/merge_requests/' + req.params.amendment_id;
},
}));
......@@ -209,14 +207,14 @@ app.post('/api/v1/project/:project_id/amendment/:amendment', proxy('localhost:80
* @apiGroup Amendment
*
* @apiParam (URL) {String} project_id the ID of the project
* @apiParam (URL) {String} amendment the amendment name
* @apiParam (URL) {String} amendment_id the amendment id
*
*/
app.delete('/api/v1/project/:project_id/amendment/:amendment', proxy('localhost:8000', {
app.delete('/api/v1/project/:project_id/amendment/:amendment_id', proxy('localhost:8000', {
proxyReqOptDecorator: proxyAuthorizationHeader,
proxyReqPathResolver: (req) => {
return '/admin/api/v4/projects/' + req.params.project_id
+ '/repository/branches/' + encodeURIComponent(req.params.amendment);
+ '/merge_requests/' + req.params.amendment_id;
},
}));
......@@ -301,12 +299,12 @@ app.delete('/api/v1/project/:project_id/amendment/:amendment', proxy('localhost:
* "developers_can_merge": false
* }
*/
app.get('/api/v1/project/:project_id/amendement', proxy('localhost:8000', {
app.get('/api/v1/project/:project_id/amendment', proxy('localhost:8000', {
proxyReqOptDecorator: proxyAuthorizationHeader,
proxyReqPathResolver: (req) => {
return '/admin/api/v4/projects/'
+ req.params.project_id
+ '/repository/branches';
+ '/merge_requests';
}
}));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment