Skip to content

Instantly share code, notes, and snippets.

@JMWebDevelopment
Created April 20, 2018 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JMWebDevelopment/d0b5f9d5042093985aaab9c513dfe16e to your computer and use it in GitHub Desktop.
Save JMWebDevelopment/d0b5f9d5042093985aaab9c513dfe16e to your computer and use it in GitHub Desktop.
function onSelectTeam( option ){
console.log('change team');
if( option === null ){
console.log(null);
getTeams().then( function( options ) {
console.log(options);
setAttributes({
team_id: "",
team_string: "",
getTeam: false,
teams: options
});
});
} else {
console.log('There is an option');
getTeams().then( function( options ) {
console.log(options);
setAttributes({
team_id: option.value,
team_string: option.label,
getTeam: true,
teams: options
});
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment