Browse Source

Fix schedule execution options modal

Fixes an issue where the option values sent to the API were initially
the default `false` instead of the existing schedule data, even though
the options were shown as the existing DB values.
After this patch, anytime edited execution options for schedules are saved,
the actual shown values are sent to the API.
Daniel Vincze 1 year ago
parent
commit
67786bd45a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/components/modules/TransferModule/Schedule/Schedule.tsx

+ 5 - 1
src/components/modules/TransferModule/Schedule/Schedule.tsx

@@ -176,9 +176,13 @@ class Schedule extends React.Component<Props, State> {
 
   handleOptionsSave(fields: Field[]) {
     this.setState({ showOptionsModal: false });
+    let execOptions = this.state.executionOptions;
+    if (!execOptions) {
+      execOptions = {};
+    }
     const options: any = {};
     fields.forEach(f => {
-      options[f.name] = f.value || false;
+      options[f.name] = f.value || execOptions[f.name] || false;
     });
 
     if (this.state.selectedSchedule && this.state.selectedSchedule.id) {