@infrab4a/connect 0.4.7-beta.0 → 0.4.7-beta.1
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 +7 -1
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +8 -2
- package/fesm2015/infrab4a-connect.js +7 -1
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -1209,11 +1209,15 @@
|
|
|
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));
|
|
1212
1214
|
if (lodash.isNil(options.action))
|
|
1213
1215
|
return options;
|
|
1214
1216
|
if (options.action === exports.UpdateOptionActions.REMOVE_FIELD)
|
|
1215
1217
|
return fieldValues.delete();
|
|
1216
1218
|
if (Array.isArray(options.value)) {
|
|
1219
|
+
console.log(options.action);
|
|
1220
|
+
console.log('options.action === UpdateOptionActions.REMOVE', options.action === exports.UpdateOptionActions.REMOVE);
|
|
1217
1221
|
if (options.action === exports.UpdateOptionActions.MERGE)
|
|
1218
1222
|
return fieldValues.arrayUnion.apply(fieldValues, __spreadArray([], __read(options.value)));
|
|
1219
1223
|
if (options.action === exports.UpdateOptionActions.REMOVE)
|
|
@@ -1255,10 +1259,12 @@
|
|
|
1255
1259
|
var model = this.model;
|
|
1256
1260
|
if (params instanceof model)
|
|
1257
1261
|
return params.toPlain();
|
|
1258
|
-
|
|
1262
|
+
var builded = Object.keys(params).reduce(function (data, currentKey) {
|
|
1259
1263
|
var _b;
|
|
1260
1264
|
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
1261
1265
|
}, {});
|
|
1266
|
+
console.log('builded', builded);
|
|
1267
|
+
return builded;
|
|
1262
1268
|
};
|
|
1263
1269
|
return UpdateFirestore;
|
|
1264
1270
|
}(MixinBase));
|