Skip to content

Commit 04e33ed

Browse files
committed
add destination name variable
1 parent 61794b6 commit 04e33ed

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/actions.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,15 @@ module.exports = {
106106
],
107107
callback: async function (action) {
108108
let options = action.options
109-
self.selectedDestination = options.destination
109+
let destination = options.destination
110+
self.selectedDestination = destination
111+
112+
//get the name from CHOICES_DESTINATIONS based on the ID
113+
let destination_name = self.CHOICES_DESTINATIONS.find((element) => element.id == destination).label
110114

111115
let variableObj = {}
112-
variableObj.destination = options.destination
116+
variableObj.destination = destination
117+
variableObj.destination_name = destination_name
113118
self.setVariableValues(variableObj)
114119
},
115120
}

src/variables.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = {
44
let variables = []
55

66
variables.push({ variableId: `destination`, name: `Selected Destination` })
7+
variables.push({ variableId: `destination_name`, name: `Selected Destination Name` })
78

89
self.setVariableDefinitions(variables)
910
},

0 commit comments

Comments
 (0)