Fix: remove events and exposed variables from component definition to avoid backend Component entity error

This commit is contained in:
Vijaykant Yadav 2024-11-14 17:29:54 +05:30
parent 7b875ad10e
commit eee6cc8b55

View file

@ -1236,8 +1236,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) {