Use JSON format for ajax requests
This commit is contained in:
parent
3f5ee7701c
commit
0db4013bb3
|
@ -1,31 +1,31 @@
|
|||
RosaABF.factory("ApiProject", ['$resource', function($resource) {
|
||||
|
||||
var ProjectResource = $resource(
|
||||
'/:owner/:project',
|
||||
'/:owner/:project?format=json',
|
||||
{owner: '@project.owner.uname', project: '@project.name'},
|
||||
{
|
||||
tags: {
|
||||
url: '/:owner/:project/tags',
|
||||
url: '/:owner/:project/tags.json',
|
||||
method: 'GET',
|
||||
isArray : false
|
||||
},
|
||||
branches: {
|
||||
url: '/:owner/:project/branches',
|
||||
url: '/:owner/:project/branches.json',
|
||||
method: 'GET',
|
||||
isArray : false
|
||||
},
|
||||
delete_branch: {
|
||||
url: '/:owner/:project/branches/:ref',
|
||||
url: '/:owner/:project/branches/:ref.json',
|
||||
method: 'DELETE',
|
||||
isArray : false
|
||||
},
|
||||
restore_branch: {
|
||||
url: '/:owner/:project/branches/:ref', // ?sha=<sha>
|
||||
url: '/:owner/:project/branches/:ref.json', // ?sha=<sha>
|
||||
method: 'PUT',
|
||||
isArray : false
|
||||
},
|
||||
create_branch: {
|
||||
url: '/:owner/:project/branches', // ?new_ref=<new_ref>&from_ref=<from_ref>
|
||||
url: '/:owner/:project/branches.json', // ?new_ref=<new_ref>&from_ref=<from_ref>
|
||||
method: 'POST',
|
||||
isArray : false
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
RosaABF.factory("ApiPullRequest", ['$resource', function($resource) {
|
||||
|
||||
var PullRequestResource = $resource(
|
||||
'/:owner/:project/pull_requests/:serial_id',
|
||||
'/:owner/:project/pull_requests/:serial_id.json',
|
||||
{
|
||||
owner: '@pull_request.to_ref.project.owner_uname',
|
||||
project: '@pull_request.to_ref.project.name',
|
||||
|
@ -13,7 +13,7 @@ RosaABF.factory("ApiPullRequest", ['$resource', function($resource) {
|
|||
isArray : false
|
||||
},
|
||||
merge: {
|
||||
url: '/:owner/:project/pull_requests/:serial_id/merge',
|
||||
url: '/:owner/:project/pull_requests/:serial_id/merge.json',
|
||||
method: 'PUT',
|
||||
isArray: false
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue