We cannot use customGET for resources, as it builds an invalid URL

This commit is contained in:
Joseph Schorr 2016-07-26 11:46:58 -07:00
parent 47b3c60b80
commit 7ac37a3813

View file

@ -21,7 +21,7 @@ angular.module('quay').factory('ApiService', ['Restangular', '$q', 'UtilService'
'hasError': false
};
getMethod(options, opt_parameters, opt_background).then(function(resp) {
getMethod(options, opt_parameters, opt_background, true).then(function(resp) {
result.value = processor(resp);
result.loading = false;
}, function(resp) {
@ -208,7 +208,7 @@ angular.module('quay').factory('ApiService', ['Restangular', '$q', 'UtilService'
var urlPath = path['x-path'];
// Add the operation itself.
apiService[operationName] = function(opt_options, opt_parameters, opt_background) {
apiService[operationName] = function(opt_options, opt_parameters, opt_background, opt_forceget) {
var one = Restangular.one(buildUrl(urlPath, opt_parameters));
if (opt_background) {
one.withHttpConfig({
@ -216,7 +216,7 @@ angular.module('quay').factory('ApiService', ['Restangular', '$q', 'UtilService'
});
}
var opObj = one['custom' + method.toUpperCase()](opt_options);
var opObj = one[opt_forceget ? 'get' : 'custom' + method.toUpperCase()](opt_options);
// If the operation requires_fresh_login, then add a specialized error handler that
// will defer the operation's result if sudo is requested.