bug envoyer carte en cours

thierry
Tmadkaud 7 years ago
parent cf06cb0adc
commit d0ed16548b

@ -167,7 +167,7 @@
</div>
</div>
<div class="text-center" style="margin-top:5%">
<button class="btn btn-light-green waves-light" [disabled]="(parSelect === '') || (birthdayTemp !== parrain.birthday)" (click)="envoyerCartePar()">Envoyer Carte {{parSelect}}</button>
<button class="btn btn-light-green waves-light" [disabled]="(parSelect === '') || (birthdayTemp !== parrain.birthday) || carteExitDeja" (click)="envoyerCartePar()">Envoyer Carte {{parSelect}}</button>
<button class="btn btn-cyan" (click)="goToOpComm()">Retour</button>
</div>
</div>

@ -63,11 +63,13 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
minDateTimeTest: Date;
maxDateTimeTest: Date;
parrainDateTimeTest: Date;
carteExitDeja: boolean;
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private route: ActivatedRoute,
private authService: AuthService, private opComService: OpCommercialService) {
this.user = afAuth.authState;
this.carteExitDeja = false;
this.radioParrain = '';
this.validC = '';
@ -316,6 +318,23 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
this.parrain = elementPaSel;
});
});
////////// not working
this.carteParList.forEach(carte => {
carte.forEach(elementCarte => {
if (elementCarte.parrainCarte.uid === this.cartePar.parrainCarte.uid) {
this.carteExitDeja = true;
console.log('eeeeeeeeeeeeeeeeeeeeee');
}
if (this.carteExitDeja === false){
//this.creerCartePar();
console.log('exist pas');
} else if (this.carteExitDeja === true){
// this.creerCartePar();
console.log('exist');
}
});
});
// console.log('this.birthday parrain : ' + this.parrain.birthday);
console.log('this.cartePar.commercantCarte.uid : ' + this.cartePar.commercantCarte.uid);
console.log('this.cartePar..parrainCarte.uid : ' + this.cartePar.parrainCarte.uid);
@ -389,8 +408,6 @@ export class EnvoyerCarteComponent implements OnInit, OnDestroy {
});
}
goToOpComm() {
this.router.navigate(['/opCommercial']);
}

Loading…
Cancel
Save