From d703e7e9c02977f18b46f99725b754954ed3b8bb Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Thu, 20 Nov 2014 13:51:24 -0800 Subject: [PATCH] Switched use of "Resource.read()" to "Resource.get()" Our resource factory attempted to define standard "CRUD" style methods by which users can access resources. By default, however, angular uses the 'get' verb. In order to reduce confusion in the larger community, this patch switches the 'read' verb in the factory back to the default 'get'. Change-Id: I3f8c0558306777675f7d55e23e0312fb49ce618d --- src/app/auth/service/session.js | 2 +- src/app/projects/controller/project_detail_controller.js | 2 +- src/app/services/service/resource_factory.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/auth/service/session.js b/src/app/auth/service/session.js index 0d92270c..2c88f942 100644 --- a/src/app/auth/service/session.js +++ b/src/app/auth/service/session.js @@ -74,7 +74,7 @@ angular.module('sb.auth').factory('Session', RefreshManager.tryRefresh().then(function () { var id = AccessToken.getIdToken(); - User.read({id: id}, + User.get({id: id}, function (user) { deferred.resolve(user); }, function (error) { diff --git a/src/app/projects/controller/project_detail_controller.js b/src/app/projects/controller/project_detail_controller.js index f776e86c..206ed35b 100644 --- a/src/app/projects/controller/project_detail_controller.js +++ b/src/app/projects/controller/project_detail_controller.js @@ -88,7 +88,7 @@ angular.module('sb.projects').controller('ProjectDetailController', * Load the project */ function loadProject() { - Project.read( + Project.get( {'id': id}, function (result) { // We've got a result, assign it to the view and unset our diff --git a/src/app/services/service/resource_factory.js b/src/app/services/service/resource_factory.js index 81a9831f..fe8740f1 100644 --- a/src/app/services/service/resource_factory.js +++ b/src/app/services/service/resource_factory.js @@ -48,7 +48,7 @@ angular.module('sb.services') 'create': { method: 'POST' }, - 'read': { + 'get': { method: 'GET', cache: false },