Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zimbra-admin-api-js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Public
zimbra-admin-api-js
Commits
98521286
Commit
98521286
authored
May 10, 2016
by
Patricio Bruna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Readme with BatchRequest onError
parent
43653e37
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
README.md
README.md
+3
-0
zimbra-admin-api.js
lib/zimbra-admin-api.js
+2
-3
zimbra-admin-api.js.map
lib/zimbra-admin-api.js.map
+1
-1
index.js
src/index.js
+2
-3
No files found.
README.md
View file @
98521286
...
...
@@ -177,6 +177,9 @@ var allDomains = zimbraApi.getAllDomains();
zimbraApi
.
makeBatchRequest
([
allAccounts
,
allDomains
],
callback
);
// Object {SearchDirectoryResponse: Array[2], _jsns: "urn:zimbra"}
// SearchDirectoryResponse[0].account, SearchDirectoryResponse[1].domain
zimbraApi
.
makeBatchRequest
([
allAccounts
,
allDomains
],
callback
,
{
onError
:
'continue'
});
// By default is {onError: 'stop'}
```
...
...
lib/zimbra-admin-api.js
View file @
98521286
...
...
@@ -195,12 +195,11 @@ return /******/ (function(modules) { // webpackBootstrap
}, {
key: 'makeBatchRequest',
value: function makeBatchRequest(request_data_array, callback) {
var
batchOnError = arguments.length <= 2 || arguments[2] === undefined ? 'continue'
: arguments[2];
var
error = arguments.length <= 2 || arguments[2] === undefined ? { onError: 'stop' }
: arguments[2];
var that = this;
var onError = batchOnError;
if (request_data_array.length === 0) return;
var request_object = this.buildRequest({ isBatch: true, batchOnError: onError });
var request_object = this.buildRequest({ isBatch: true, batchOnError:
error.
onError });
request_data_array.forEach(function (request_data) {
request_object.addRequest(request_data.params, function (err, reqid) {
if (err) return that.handleError(err);
lib/zimbra-admin-api.js.map
View file @
98521286
This diff is collapsed.
Click to expand it.
src/index.js
View file @
98521286
...
...
@@ -98,11 +98,10 @@ export default class ZimbraAdminApi {
return
request
;
}
makeBatchRequest
(
request_data_array
,
callback
,
batchOnError
=
'continue'
)
{
makeBatchRequest
(
request_data_array
,
callback
,
error
=
{
onError
:
'stop'
}
)
{
const
that
=
this
;
const
onError
=
batchOnError
;
if
(
request_data_array
.
length
===
0
)
return
;
let
request_object
=
this
.
buildRequest
({
isBatch
:
true
,
batchOnError
:
onError
});
let
request_object
=
this
.
buildRequest
({
isBatch
:
true
,
batchOnError
:
error
.
onError
});
request_data_array
.
forEach
((
request_data
)
=>
{
request_object
.
addRequest
(
request_data
.
params
,
function
(
err
,
reqid
){
if
(
err
)
return
that
.
handleError
(
err
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment