pinia-orm-edge 1.9.0-28579621.2ab09a1 → 1.9.0-28580088.76eb4a5
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/dist/index.cjs +1 -4
- package/dist/index.mjs +1 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
@@ -1489,12 +1489,9 @@ class Query {
|
|
1489
1489
|
const modelByType = this.model.$types()[record[this.model.$typeKey()]];
|
1490
1490
|
const getNewInsance = (newOptions) => (modelByType ? modelByType.newRawInstance() : this.model).$newInstance(record, { relations: false, ...options || {}, ...newOptions });
|
1491
1491
|
const hydratedModel = getNewInsance();
|
1492
|
-
if (id && !this.getNewHydrated && options?.operation !== "set") {
|
1492
|
+
if (id && (!this.getNewHydrated && options?.operation !== "set" || options?.action === "update")) {
|
1493
1493
|
this.hydratedDataCache.set(this.model.$entity() + id, hydratedModel);
|
1494
1494
|
}
|
1495
|
-
if (id && options?.action === "update") {
|
1496
|
-
this.hydratedDataCache.set(this.model.$entity() + id, getNewInsance({ operation: "get" }));
|
1497
|
-
}
|
1498
1495
|
return hydratedModel;
|
1499
1496
|
}
|
1500
1497
|
}
|
package/dist/index.mjs
CHANGED
@@ -1487,12 +1487,9 @@ class Query {
|
|
1487
1487
|
const modelByType = this.model.$types()[record[this.model.$typeKey()]];
|
1488
1488
|
const getNewInsance = (newOptions) => (modelByType ? modelByType.newRawInstance() : this.model).$newInstance(record, { relations: false, ...options || {}, ...newOptions });
|
1489
1489
|
const hydratedModel = getNewInsance();
|
1490
|
-
if (id && !this.getNewHydrated && options?.operation !== "set") {
|
1490
|
+
if (id && (!this.getNewHydrated && options?.operation !== "set" || options?.action === "update")) {
|
1491
1491
|
this.hydratedDataCache.set(this.model.$entity() + id, hydratedModel);
|
1492
1492
|
}
|
1493
|
-
if (id && options?.action === "update") {
|
1494
|
-
this.hydratedDataCache.set(this.model.$entity() + id, getNewInsance({ operation: "get" }));
|
1495
|
-
}
|
1496
1493
|
return hydratedModel;
|
1497
1494
|
}
|
1498
1495
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pinia-orm-edge",
|
3
|
-
"version": "1.9.0-
|
3
|
+
"version": "1.9.0-28580088.76eb4a5",
|
4
4
|
"description": "The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.",
|
5
5
|
"keywords": [
|
6
6
|
"vue",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"pinia": "^2.1.7"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.0-
|
49
|
+
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.9.0-28580088.76eb4a5"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
52
|
"@nuxt/eslint-config": "^0.3.10",
|