|
1 | 1 | import DataLoader from 'dataloader';
|
| 2 | +import castArray from 'lodash/castArray'; |
2 | 3 | import get from 'lodash/get';
|
3 | 4 | import isError from 'lodash/isError';
|
4 | 5 | import mapValues from 'lodash/mapValues';
|
@@ -120,17 +121,25 @@ export class ZimbraBatchClient {
|
120 | 121 | this.jsonRequest({
|
121 | 122 | name: 'GetInfo',
|
122 | 123 | namespace: Namespace.Account
|
123 |
| - }).then(res => ({ |
124 |
| - ...res, |
125 |
| - attrs: mapValuesDeep(res.attrs._attrs, coerceStringToBoolean), |
126 |
| - prefs: mapValuesDeep(res.prefs._attrs, coerceStringToBoolean), |
127 |
| - ...(get(res, 'license.attr') && { |
128 |
| - license: { |
129 |
| - status: res.license.status, |
130 |
| - attr: mapValuesDeep(res.license.attr, coerceStringToBoolean) |
131 |
| - } |
132 |
| - }) |
133 |
| - })); |
| 124 | + }).then(res => { |
| 125 | + let prefs: any = mapValuesDeep(res.prefs._attrs, coerceStringToBoolean); |
| 126 | + prefs.zimbraPrefMailTrustedSenderList = |
| 127 | + typeof prefs.zimbraPrefMailTrustedSenderList === 'string' |
| 128 | + ? castArray(prefs.zimbraPrefMailTrustedSenderList) |
| 129 | + : prefs.zimbraPrefMailTrustedSenderList; |
| 130 | + |
| 131 | + return { |
| 132 | + ...res, |
| 133 | + attrs: mapValuesDeep(res.attrs._attrs, coerceStringToBoolean), |
| 134 | + prefs, |
| 135 | + ...(get(res, 'license.attr') && { |
| 136 | + license: { |
| 137 | + status: res.license.status, |
| 138 | + attr: mapValuesDeep(res.license.attr, coerceStringToBoolean) |
| 139 | + } |
| 140 | + }) |
| 141 | + }; |
| 142 | + }); |
134 | 143 |
|
135 | 144 | public action = (type: ActionType, options: ActionOptions) => {
|
136 | 145 | const { ids, id, ...rest } = options;
|
|
0 commit comments