@ronin/compiler 0.17.5 → 0.17.6
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.js +5 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1856,7 +1856,7 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query,
|
|
1856
1856
|
}
|
1857
1857
|
};
|
1858
1858
|
}
|
1859
|
-
const modelBeforeUpdate = structuredClone(model);
|
1859
|
+
const modelBeforeUpdate = structuredClone(JSON.parse(JSON.stringify(model)));
|
1860
1860
|
const existingModel = model;
|
1861
1861
|
const pluralType = PLURAL_MODEL_ENTITIES[entity];
|
1862
1862
|
const existingEntity = existingModel[pluralType]?.[slug];
|
@@ -2004,10 +2004,11 @@ var transformMetaQuery = (models, dependencyStatements, statementParams, query,
|
|
2004
2004
|
let json;
|
2005
2005
|
switch (action) {
|
2006
2006
|
case "create": {
|
2007
|
-
const
|
2008
|
-
|
2007
|
+
const { slug: slug2, ...entityValue } = jsonValue;
|
2008
|
+
const value = prepareStatementValue(statementParams, entityValue);
|
2009
|
+
json = `json_insert(${field}, '$.${slug2}', ${value})`;
|
2009
2010
|
if (!existingModel[pluralType]) existingModel[pluralType] = {};
|
2010
|
-
existingModel[pluralType][
|
2011
|
+
existingModel[pluralType][slug2] = jsonValue;
|
2011
2012
|
break;
|
2012
2013
|
}
|
2013
2014
|
case "alter": {
|