@infrab4a/connect 0.4.7-beta.1 → 0.4.7-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/infrab4a-connect.umd.js +1 -7
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +2 -8
- package/fesm2015/infrab4a-connect.js +1 -7
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +2 -2
|
@@ -1209,15 +1209,11 @@
|
|
|
1209
1209
|
var getValueFromParams = function (params, field) { var _a; return (lodash.isNil((_a = params[field]) === null || _a === void 0 ? void 0 : _a.value) ? params[field] : params[field].value) || null; };
|
|
1210
1210
|
var getValueByAction = function (options) {
|
|
1211
1211
|
var fieldValues = firebase__default["default"].firestore.FieldValue;
|
|
1212
|
-
console.log(options.value);
|
|
1213
|
-
console.log('Array.isArray(options.value)', Array.isArray(options.value));
|
|
1214
1212
|
if (lodash.isNil(options.action))
|
|
1215
1213
|
return options;
|
|
1216
1214
|
if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
|
|
1217
1215
|
return fieldValues.delete();
|
|
1218
1216
|
if (Array.isArray(options.value)) {
|
|
1219
|
-
console.log(options.action);
|
|
1220
|
-
console.log('options.action === UpdateOptionActions.REMOVE', options.action === exports.UpdateOptionActions.REMOVE);
|
|
1221
1217
|
if (options.action === exports.UpdateOptionActions.MERGE)
|
|
1222
1218
|
return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1223
1219
|
if (options.action === exports.UpdateOptionActions.REMOVE)
|
|
@@ -1259,12 +1255,10 @@
|
|
|
1259
1255
|
var model = this.model;
|
|
1260
1256
|
if (params instanceof model)
|
|
1261
1257
|
return params.toPlain();
|
|
1262
|
-
|
|
1258
|
+
return Object.keys(params).reduce(function (data, currentKey) {
|
|
1263
1259
|
var _b;
|
|
1264
1260
|
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
1265
1261
|
}, {});
|
|
1266
|
-
console.log('builded', builded);
|
|
1267
|
-
return builded;
|
|
1268
1262
|
};
|
|
1269
1263
|
return UpdateFirestore;
|
|
1270
1264
|
}(MixinBase));
|