mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Merge pull request #11332 from ToolJet/fix/component-saving-on-page-clone
Fix: remove events and exposed variables from component definition to avoid backend Component entity error
This commit is contained in:
commit
d02174e9cf
1 changed files with 18 additions and 2 deletions
|
|
@ -1192,8 +1192,16 @@ export const createComponentsSlice = (set, get) => ({
|
|||
'setComponentProperty'
|
||||
);
|
||||
|
||||
const oldComponent = get().modules[moduleId].pages[currentPageIndex].components[componentId].component;
|
||||
const { events, exposedVariables, ...filteredDefinition } = oldComponent.definition || {};
|
||||
|
||||
const diff = {
|
||||
[componentId]: { component: get().modules[moduleId].pages[currentPageIndex].components[componentId].component },
|
||||
[componentId]: {
|
||||
component: {
|
||||
...oldComponent,
|
||||
definition: filteredDefinition,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if (saveAfterAction) {
|
||||
|
|
@ -1236,8 +1244,16 @@ export const createComponentsSlice = (set, get) => ({
|
|||
);
|
||||
}
|
||||
|
||||
const oldComponent = get().modules[moduleId].pages[currentPageIndex].components[componentId].component;
|
||||
const { events, exposedVariables, ...filteredDefinition } = oldComponent.definition || {};
|
||||
|
||||
const diff = {
|
||||
[componentId]: { component: get().modules[moduleId].pages[currentPageIndex].components[componentId].component },
|
||||
[componentId]: {
|
||||
component: {
|
||||
...oldComponent,
|
||||
definition: filteredDefinition,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
if (saveAfterAction) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue