Commit 49e8aeed authored by Patricio Bruna's avatar Patricio Bruna

test parseResponse with error true instead of null

parent 27a77ef7
...@@ -286,7 +286,7 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -286,7 +286,7 @@ return /******/ (function(modules) { // webpackBootstrap
var response_name = that.dictionary.resourceResponseName(resource); var response_name = that.dictionary.resourceResponseName(resource);
var response_object = data.get()[request_data.response_name][response_name][0]; var response_object = data.get()[request_data.response_name][response_name][0];
var result = that.dictionary.classFactory(resource, response_object, that); var result = that.dictionary.classFactory(resource, response_object, that);
return callback(null, result); return callback(true, result);
} }
// For requests that returns empty Object when Success // For requests that returns empty Object when Success
...@@ -530,6 +530,8 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -530,6 +530,8 @@ return /******/ (function(modules) { // webpackBootstrap
}, { }, {
key: 'getGrants', key: 'getGrants',
value: function getGrants(target_data, grantee_data, callback) { value: function getGrants(target_data, grantee_data, callback) {
var forBatch = arguments.length <= 3 || arguments[3] === undefined ? false : arguments[3];
var _dictionary$buildTarg3 = this.dictionary.buildTargetGrantee(target_data, grantee_data); var _dictionary$buildTarg3 = this.dictionary.buildTargetGrantee(target_data, grantee_data);
var _dictionary$buildTarg4 = (0, _slicedToArray3.default)(_dictionary$buildTarg3, 2); var _dictionary$buildTarg4 = (0, _slicedToArray3.default)(_dictionary$buildTarg3, 2);
...@@ -542,6 +544,7 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -542,6 +544,7 @@ return /******/ (function(modules) { // webpackBootstrap
request_data.parse_response = this.parseAllResponse; request_data.parse_response = this.parseAllResponse;
request_data.params.params.grantee = grantee; request_data.params.params.grantee = grantee;
request_data.params.params.target = target; request_data.params.params.target = target;
if (forBatch) return request_data;
this.performRequest(request_data); this.performRequest(request_data);
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -177,7 +177,7 @@ export default class ZimbraAdminApi { ...@@ -177,7 +177,7 @@ export default class ZimbraAdminApi {
const response_name = that.dictionary.resourceResponseName(resource); const response_name = that.dictionary.resourceResponseName(resource);
const response_object = data.get()[request_data.response_name][response_name][0]; const response_object = data.get()[request_data.response_name][response_name][0];
const result = that.dictionary.classFactory(resource, response_object, that); const result = that.dictionary.classFactory(resource, response_object, that);
return callback(null, result); return callback(true, result);
} }
// For requests that returns empty Object when Success // For requests that returns empty Object when Success
...@@ -368,13 +368,14 @@ export default class ZimbraAdminApi { ...@@ -368,13 +368,14 @@ export default class ZimbraAdminApi {
// type: (account|cos|dl|domain), // type: (account|cos|dl|domain),
// identifier: (name or zimbraId) // identifier: (name or zimbraId)
// } // }
getGrants(target_data, grantee_data, callback) { getGrants(target_data, grantee_data, callback, forBatch = false) {
const [target, grantee] = this.dictionary.buildTargetGrantee(target_data, grantee_data); const [target, grantee] = this.dictionary.buildTargetGrantee(target_data, grantee_data);
const request_data = this.buildRequestData('GetGrants', callback); const request_data = this.buildRequestData('GetGrants', callback);
request_data.resource = 'Grant'; request_data.resource = 'Grant';
request_data.parse_response = this.parseAllResponse; request_data.parse_response = this.parseAllResponse;
request_data.params.params.grantee = grantee; request_data.params.params.grantee = grantee;
request_data.params.params.target = target; request_data.params.params.target = target;
if (forBatch) return request_data;
this.performRequest(request_data); this.performRequest(request_data);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment