File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ class InputData {
8
8
if ( this . lookupFieldIsPopulated ( lookupField ) ) this . data [ apiField ] = this . formatData ( this . lookup [ lookupField ] ) ;
9
9
}
10
10
11
+ addCustomParameter ( key , value ) {
12
+ this . data [ key ] = value ;
13
+ }
14
+
11
15
formatData ( field ) {
12
16
if ( Array . isArray ( field ) ) return field . join ( ";" ) ;
13
17
else return field ;
Original file line number Diff line number Diff line change @@ -19,7 +19,13 @@ class Lookup {
19
19
this . inputId = inputId ;
20
20
this . format = format ;
21
21
this . result = [ ] ;
22
+ this . customParameters = { } ;
22
23
}
24
+
25
+ addCustomParameter ( key , value ) {
26
+ this . customParameters [ key ] = value ;
27
+ }
28
+
23
29
}
24
30
25
31
module . exports = Lookup ;
Original file line number Diff line number Diff line change @@ -3,9 +3,17 @@ const InputData = require("../InputData");
3
3
module . exports = ( lookup , keyTranslationFormat ) => {
4
4
let inputData = new InputData ( lookup ) ;
5
5
6
+ const hasCustomParameters = Object . keys ( lookup . customParameters ) . length > 0 ;
7
+
6
8
for ( let key in keyTranslationFormat ) {
7
9
inputData . add ( key , keyTranslationFormat [ key ] ) ;
8
10
}
9
11
12
+ if ( hasCustomParameters ) {
13
+ for ( let key in lookup . customParameters ) {
14
+ inputData . addCustomParameter ( key , lookup . customParameters [ key ] ) ;
15
+ }
16
+ }
17
+
10
18
return inputData . data ;
11
19
} ;
You can’t perform that action at this time.
0 commit comments