- updated version;
This commit is contained in:
@@ -42,5 +42,15 @@ export const actionsBeta = (set, get, api) => ({
|
||||
const newElements = newFields.toSpliced(hoverIndex, 0, prevFields[dragIndex]);
|
||||
set.formElements(newElements);
|
||||
}
|
||||
},
|
||||
addFlowData: (data) => {
|
||||
const initial = get.flowData();
|
||||
const exists = initial ? initial.filter(o => o.formId === data.formId) : [];
|
||||
if (exists.length) {
|
||||
const newData = initial.map(o => o.formId === data.formId ? data : o);
|
||||
set.flowData(newData);
|
||||
} else {
|
||||
set.flowData([...initial, data]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,12 +5,18 @@ const initialStore = {
|
||||
// user
|
||||
userData: {},
|
||||
token: '',
|
||||
// bando form
|
||||
formInitialData: {},
|
||||
// form builder
|
||||
formId: 0,
|
||||
formLabel: '',
|
||||
formElements: [],
|
||||
elementItems: [],
|
||||
activeElement: ''
|
||||
activeElement: '',
|
||||
// flow
|
||||
flowData: [],
|
||||
flowForms: [],
|
||||
flowEdges: []
|
||||
}
|
||||
|
||||
export default initialStore;
|
||||
Reference in New Issue
Block a user