diff --git a/src/view/nav-bar.js b/src/view/nav-bar.js index 7314259..5361cfd 100644 --- a/src/view/nav-bar.js +++ b/src/view/nav-bar.js @@ -66,15 +66,17 @@ export default{ } }, addTeam: function(){ - let team = new Team(this.id, this.name, this.description); - console.log(team); if(!this.edit){//adding a team + let team = new Team(this.id, this.name, this.description); + console.log(team); this.teams.push(team); this.name=''; this.description=''; this.id=this.id+1 } else{//editing a team + let team = new Team(this.teams[this.idxEdit].id, this.name, this.description); + console.log(team); this.teams[this.idxEdit]=team; this.name=''; this.description='';