public/js/models/layerRecord.js in conjur-asset-ui-1.3.1 vs public/js/models/layerRecord.js in conjur-asset-ui-1.3.2

- old
+ new

@@ -1,7 +1,5 @@ -/* global conjur, jQuery, _, async */ - (function(conjur, $, _, async, errback) { 'use strict'; var Generic = this.Generic; @@ -18,25 +16,26 @@ }; Layer.prototype = Object.create(Generic.prototype); Layer.prototype.constructor = Layer; - Layer.prototype.fetch = function(callback, customErrback) { - var id = this.id; + Layer.prototype.fetch = function(callback, custom_errback) { + var self = this, + id = this.id; - if (typeof(customErrback) === 'undefined') { - customErrback = errback; // reset to default + if (typeof(custom_errback) === 'undefined') { + custom_errback = errback; // reset to default } function members(role) { return function(cb) { $.ajax({ - url: '/api/authz/' + - conjur.app.configuration.account + - '/roles/' + - role + - '?members', + url: '/api/authz/' + + conjur.app.configuration.account + + '/roles/' + + role + + '?members', success: function(result) { cb(null, result); }, error: cb }); @@ -50,10 +49,10 @@ members('@/layer/' + id + '/admin_host'), this.allRoles.bind(this), this.resource.bind(this) ], function(err, results) { if (err) { - return customErrback(err.status); + return custom_errback(err.status); } callback({ layer: results[0], owned: results[1],