Skip to content

Commit

Permalink
Ajout gestion change ETAPE
Browse files Browse the repository at this point in the history
+gestion typeSupp
  • Loading branch information
SamuelQuetin committed Aug 21, 2024
1 parent abbb7fe commit 5bd0cdc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/views/Suppression/SuppSteps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,29 @@ function setTypeSelected(){
demandesService.modifierTypeFileDemande(demande.value.id, typeFileSelected.value)
}
function changeEtape() {
if (((currentStep.value + 1) === 1) || ((currentStep.value + 1) === 2 && !typeFileSelected.value)) {
demandesService.choixEtape(demande.value.id, 1, 'SUPP')
.then(response => {
demande.value = response.data;
});
typeFileSelected.value = null;
}
if ((currentStep.value + 1) === 2 && typeFileSelected.value) { //Changement d'etat pour le chargement du fichier car le back est perdu sinon
demandesService.choixEtape(demande.value.id, 2, 'SUPP')
.then(response => {
demande.value = response.data;
});
}
}
function prevSelectTypeFile(){
typeFileSelected.value = null;
changeEtape()
raz();
}
function prevSelectFile(){
changeEtape()
raz();
}
function next() {
Expand All @@ -201,6 +219,7 @@ function next() {
function prev() {
currentStep.value--;
changeEtape()
raz();
}
Expand Down

0 comments on commit 5bd0cdc

Please sign in to comment.