@infrab4a/connect 0.7.0 → 0.7.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 +4 -4
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/lib/domain/general/model/types/base-model-builder.type.js +1 -1
- package/esm2015/lib/infra/firebase/firestore/mixins/with-update-firestore.mixin.js +4 -4
- package/fesm2015/infrab4a-connect.js +3 -3
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/lib/domain/general/model/types/base-model-builder.type.d.ts +1 -1
- package/lib/domain/users/models/user.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1372,7 +1372,7 @@
|
|
|
1372
1372
|
model = new this.model();
|
|
1373
1373
|
keyField = model.identifierFields().shift();
|
|
1374
1374
|
docRef = this.collection(this.buildCollectionPathForUpdate(data)).doc(getValueFromParams(data, keyField).toString());
|
|
1375
|
-
return [4 /*yield*/, docRef.
|
|
1375
|
+
return [4 /*yield*/, docRef.set(this.paramsToPlain(data), { merge: true })];
|
|
1376
1376
|
case 1:
|
|
1377
1377
|
_b.sent();
|
|
1378
1378
|
return [4 /*yield*/, docRef.get()];
|
|
@@ -1391,11 +1391,11 @@
|
|
|
1391
1391
|
UpdateFirestore.prototype.paramsToPlain = function (params) {
|
|
1392
1392
|
var model = this.model;
|
|
1393
1393
|
if (params instanceof model)
|
|
1394
|
-
return params
|
|
1395
|
-
return Object.keys(params).reduce(function (data, currentKey) {
|
|
1394
|
+
return params;
|
|
1395
|
+
return new model(Object.keys(params).reduce(function (data, currentKey) {
|
|
1396
1396
|
var _b;
|
|
1397
1397
|
return (Object.assign(Object.assign({}, data), (_b = {}, _b[currentKey] = getValueByAction(params[currentKey]), _b)));
|
|
1398
|
-
}, {});
|
|
1398
|
+
}, {}));
|
|
1399
1399
|
};
|
|
1400
1400
|
return UpdateFirestore;
|
|
1401
1401
|
}(MixinBase));
|