Browse Source

put updateParam back in

Sven Klemm 7 years ago
parent
commit
d9db3d1402
1 changed files with 11 additions and 0 deletions
  1. 11 0
      public/app/core/components/sql_part/sql_part.ts

+ 11 - 0
public/app/core/components/sql_part/sql_part.ts

@@ -64,6 +64,17 @@ export class SqlPart {
     this.params = part.params;
   }
 
+  updateParam(strValue, index) {
+    // handle optional parameters
+    if (strValue === '' && this.def.params[index].optional) {
+      this.params.splice(index, 1);
+    } else {
+      this.params[index] = strValue;
+    }
+
+    this.part.params = this.params;
+  }
+
   render(innerExpr: string) {
     return this.def.renderer(this, innerExpr);
   }