From 0db4013bb316eaf99e95b4647cdf48f9fced2844 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 1 Aug 2013 13:26:59 +0400 Subject: [PATCH] Use JSON format for ajax requests --- app/assets/javascripts/angularjs/services/project.js | 12 ++++++------ .../javascripts/angularjs/services/pull_request.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/angularjs/services/project.js b/app/assets/javascripts/angularjs/services/project.js index 851a95a98..a1fb48023 100644 --- a/app/assets/javascripts/angularjs/services/project.js +++ b/app/assets/javascripts/angularjs/services/project.js @@ -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= + url: '/:owner/:project/branches/:ref.json', // ?sha= method: 'PUT', isArray : false }, create_branch: { - url: '/:owner/:project/branches', // ?new_ref=&from_ref= + url: '/:owner/:project/branches.json', // ?new_ref=&from_ref= method: 'POST', isArray : false } diff --git a/app/assets/javascripts/angularjs/services/pull_request.js b/app/assets/javascripts/angularjs/services/pull_request.js index 95aeb96ea..d7fff32e5 100644 --- a/app/assets/javascripts/angularjs/services/pull_request.js +++ b/app/assets/javascripts/angularjs/services/pull_request.js @@ -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 }