Commit 5330aafa authored by Patricio Bruna's avatar Patricio Bruna

Fixed code sintax and removed indent check from linter

parent bedfce6f
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
"consistent-this": [2, "self"], "consistent-this": [2, "self"],
"func-names": 2, "func-names": 2,
"func-style": [2, "declaration"], "func-style": [2, "declaration"],
"indent": [2, 4, {"SwitchCase": 0}], # "indent": [2, 2, {"SwitchCase": 0}],
"jsx-quotes": [2, "prefer-single"], "jsx-quotes": [2, "prefer-single"],
"key-spacing": [2, {"beforeColon": false, "afterColon": true}], "key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"linebreak-style": 2, "linebreak-style": 2,
......
...@@ -587,46 +587,37 @@ export function batchRequest(requestArray, success, error) { ...@@ -587,46 +587,37 @@ export function batchRequest(requestArray, success, error) {
} }
export function getAllCos(success, error) { export function getAllCos(success, error) {
initZimbra().then( initZimbra().then(
(zimbra) => { (zimbra) => {
if (UserStore.isGlobalAdmin()) { if (UserStore.isGlobalAdmin()) {
zimbra.getAllCos((err, data) => { zimbra.getAllCos((err, data) => {
if (err) { if (err) {
const e = handleError('getAllCos', err); return error(handleError('getAllCos', err));
if (error) { }
return error(e); return success(data);
} });
} } else {
const batchRequests = [];
return success(data); const planNames = Object.keys(window.manager_config.plans);
}); planNames.forEach((plan) => {
} else { batchRequests.push(zimbra.getCos(plan));
const batchRequests = []; });
const plans_names = Object.keys(window.manager_config.plans);
plans_names.forEach((plan) => {
batchRequests.push(zimbra.getCos(plan));
});
zimbra.makeBatchRequest(batchRequests, (err, data) => {
if (err) {
const e = handleError('getCos', err);
if (error) {
return error(e);
}
}
return success(data.GetCosResponse.map((r) => {return r.cos[0];}));
});
}
},
(err) => {
const e = handleError('getAllCos', err);
if (error) {
return error(e);
}
return null; zimbra.makeBatchRequest(batchRequests, (err, data) => {
} if (err) {
); return error(handleError('getCos', err));
}
const allCos = data.GetCosResponse.map((r) => {
return r.cos[0];
});
return success(allCos);
});
}
},
(err) => {
return error(handleError('getAllCos', err));
}
);
} }
export function getAllDistributionLists(query, success, error) { export function getAllDistributionLists(query, success, error) {
......
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