diff --git a/src/view/team-add.js b/src/view/team-add.js index afd207c..7c2589a 100644 --- a/src/view/team-add.js +++ b/src/view/team-add.js @@ -18,6 +18,12 @@ export default { addTeam: function () { try { + if (this.teamAEdit != null) { + this.id = this.teamAEdit.id + this.name = this.teamAEdit.name + this.description = this.teamAEdit.description + } + this.errorMessage = ''; if (!this.id) { throw new RequiredFieldError("ID"); @@ -37,9 +43,11 @@ export default { const team = { id: this.id, name: this.name, description: this.description}; + if (this.teamAEdit != null) { this.$emit('teamModifie', team); } else { + this.$emit('teamAjoute', team); } @@ -63,15 +71,18 @@ export default {