Unverified Commit 82ed1849 authored by Zhou (Link)  Fang's avatar Zhou (Link) Fang Committed by GitHub
Browse files

Improved WG fetch logic (#241)

parent 9c72a6c3
......@@ -164,18 +164,26 @@ export default function Application() {
setUpdatedFormValues({ ...updatedFormValues, workingGroups });
console.log('updated working groups: ', values);
const setFieldValueObj = {
fieldName: 'workingGroups',
method: formikWorkingGroups.setFieldValue,
};
executeSendDataByStep(
3,
values,
currentFormId,
currentUser.name,
goToNextStep,
setFieldValueObj
);
if (values.isJoiningWG){
// If the user is joining at least 1 wg, then make related API call
const setFieldValueObj = {
fieldName: 'workingGroups',
method: formikWorkingGroups.setFieldValue,
};
executeSendDataByStep(
3,
values,
currentFormId,
currentUser.name,
goToNextStep,
setFieldValueObj
);
} else {
// If the user is NOT joining any wg, then go to next page directly
goToNextStep(3, '/signing-authority')
}
},
});
......
......@@ -120,8 +120,8 @@ const WorkingGroupsWrapper = ({ formik, isStartNewForm }) => {
})
.then((data) => {
let options = data.map((item) => ({
label: item.title,
value: item.title,
label: item.title || item.name,
value: item.title || item.name,
participation_levels: item.levels,
}));
setFullWorkingGroupList(options);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment