From babf24874420ef0fa87df8b41ba8227bdcade2e3 Mon Sep 17 00:00:00 2001 From: Raphael LACOTE Date: Sun, 19 Mar 2023 15:51:57 +0100 Subject: [PATCH 1/2] Resolution d'un premier bug sur le boutton edir --- src/view/team-add.js | 3 +-- src/view/team.js | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/view/team-add.js b/src/view/team-add.js index 0385cf7..bd18a09 100644 --- a/src/view/team-add.js +++ b/src/view/team-add.js @@ -67,8 +67,7 @@ export default {
{{ errorMessage }}

- - {{this.id}} +

diff --git a/src/view/team.js b/src/view/team.js index be3fa85..c9a4e8b 100644 --- a/src/view/team.js +++ b/src/view/team.js @@ -11,22 +11,19 @@ export default { }, methods: { recupTeam: function (team) { - console.log('team.addTeam', team); this.allTeam.push(team); }, editParam: function (team) { this.teamAEdit=team - console.log('lanceEdit') }, updateTeam: function (team) { - console.log('update') for (var i = 0; i < this.allTeam.length; i++) { if (this.allTeam[i].id == this.teamAEdit.id) { - console.log('update + +') this.allTeam[i].name = team.name this.allTeam[i].description=team.description } } + this.teamAEdit = null } From 10e2b5813837a8ff465622b90852d2e75556b1ad Mon Sep 17 00:00:00 2001 From: Raphael LACOTE Date: Sun, 19 Mar 2023 16:14:03 +0100 Subject: [PATCH 2/2] =?UTF-8?q?R=C3=A9paration=20du=20bug=20de=20la=20q8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/team-add.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/view/team-add.js b/src/view/team-add.js index bd18a09..2718ca7 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"); @@ -38,12 +44,13 @@ export default { throw new StringSize("Name", NAME_MINIMAL_SIZE) } - const team = { id: this.id, name: this.name, description: this.description}; - console.log('form.addTeam', team); + const team = { id: this.id, name: this.name, description: this.description }; + if (this.teamAEdit != null) { this.$emit('teamModifie', team); } else { + this.$emit('teamAjoute', team); } @@ -67,15 +74,18 @@ export default {
{{ errorMessage }}

- +

+


- +

+


- +