@dnax/core 0.1.10 → 0.1.11

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.
@@ -812,33 +812,31 @@ class useRest {
812
812
  });
813
813
  }
814
814
 
815
- if (typeof id == "string") {
816
- result.doc = await this.#tenant.database.db
817
- ?.collection(collection)
818
- .findOneAndUpdate(
819
- {
820
- ...(formatData(filter) || {}),
821
- },
822
- {
823
- ...formatData(omit(update, omitUpdate)),
824
- $currentDate: {
825
- updatedAt: true,
826
- },
815
+ result.doc = await this.#tenant.database.db
816
+ ?.collection(collection)
817
+ .findOneAndUpdate(
818
+ {
819
+ ...(formatData(filter) || {}),
820
+ },
821
+ {
822
+ ...formatData(omit(update, omitUpdate)),
823
+ $currentDate: {
824
+ updatedAt: true,
827
825
  },
828
- {
829
- upsert: true,
830
- returnDocument: "after",
831
- session: this.#session ? this.#session : undefined,
832
- }
833
- );
834
- }
826
+ },
827
+ {
828
+ upsert: true,
829
+ returnDocument: "after",
830
+ session: this.#session ? this.#session : undefined,
831
+ }
832
+ );
835
833
 
836
834
  if (col?.hooks?.afterUpdate && useHook) {
837
835
  await col.hooks.afterUpdate({
838
836
  sharedData: sharedData,
839
837
  c: this.#c,
840
838
  driver: "mongodb",
841
- id: id,
839
+ filter: filter,
842
840
  action: "updateOne",
843
841
  update: update,
844
842
  session: sessionStorage(),
@@ -1037,6 +1035,7 @@ class useRest {
1037
1035
  sharedData: sharedData,
1038
1036
  id: id,
1039
1037
  c: this.#c,
1038
+ io: Cfg.io,
1040
1039
  driver: "mongodb",
1041
1040
  action: "deleteOne",
1042
1041
  session: sessionStorage(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {