adminforth 1.10.0-next.8 → 1.10.0-next.9
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.
|
@@ -116,15 +116,14 @@ onMounted(async () => {
|
|
|
116
116
|
await coreStore.fetchResourceFull({
|
|
117
117
|
resourceId: route.params.resourceId
|
|
118
118
|
});
|
|
119
|
+
initialValues.value = (coreStore.resource?.columns || []).reduce((acc, column) => {
|
|
120
|
+
if (column.suggestOnCreate !== undefined) {
|
|
121
|
+
acc[column.name] = column.suggestOnCreate;
|
|
122
|
+
}
|
|
123
|
+
return acc;
|
|
124
|
+
}, {});
|
|
119
125
|
if (route.query.values) {
|
|
120
|
-
initialValues.value = JSON.parse(decodeURIComponent(route.query.values));
|
|
121
|
-
} else {
|
|
122
|
-
initialValues.value = (coreStore.resource?.columns || []).reduce((acc, column) => {
|
|
123
|
-
if (column.suggestOnCreate !== undefined) {
|
|
124
|
-
acc[column.name] = column.suggestOnCreate;
|
|
125
|
-
}
|
|
126
|
-
return acc;
|
|
127
|
-
}, {});
|
|
126
|
+
initialValues.value = { ...initialValues.value, ...JSON.parse(decodeURIComponent(route.query.values)) };
|
|
128
127
|
}
|
|
129
128
|
record.value = initialValues.value;
|
|
130
129
|
loading.value = false;
|