소스 검색

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 년 전
부모
커밋
67786bd45a
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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) {