@social-mail/social-mail-client 1.1.3 → 1.1.4
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/admin/AdminAppIndex.pack.js +7 -5
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/common/controls/collection-editor/CollectionEditor.js +7 -5
- package/dist/common/controls/collection-editor/CollectionEditor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +7 -5
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +1 -1
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/package.json +1 -1
- package/src/common/controls/collection-editor/CollectionEditor.tsx +4 -4
package/package.json
CHANGED
|
@@ -45,8 +45,6 @@ export default function CollectionEditor<T>({
|
|
|
45
45
|
|
|
46
46
|
const onAddItem = async () => {
|
|
47
47
|
const es = repeater.app.resolve(EntityService);
|
|
48
|
-
const clone = es.cloner(model).copy;
|
|
49
|
-
const copy = (clone[collection] ??= [] as any) as any;
|
|
50
48
|
let newItem;
|
|
51
49
|
if (addPage) {
|
|
52
50
|
const result = await PageNavigator.pushPageForResult(addPage, addItemDefaults ?? {});
|
|
@@ -61,8 +59,10 @@ export default function CollectionEditor<T>({
|
|
|
61
59
|
if (newItem?.then) {
|
|
62
60
|
newItem = await newItem;
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
const draft = { model, [collection]: [newItem] };
|
|
63
|
+
const clone = es.cloner(draft);
|
|
64
|
+
clone.include(`(x) => x.${collection}` as any);
|
|
65
|
+
await es.save(clone.copy as any);
|
|
66
66
|
repeater.items.add(newItem);
|
|
67
67
|
};
|
|
68
68
|
|