@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.
@@ -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.update(this.paramsToPlain(data))];
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.toPlain();
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));