admin fonction rejeter valider

thierry
Tmadkaud 7 years ago
parent 98345b2b91
commit 58abd1fe75

@ -26,6 +26,7 @@
<div class="card-block row">
<div class="col-md-8" id="subCard2Part1">
<div id="opTitle">
<label>Validation: {{op.validationXJC}}</label>
<label>Operation Commerciale: {{op.name}}</label>
</div>
<div id="opAvantages">

@ -24,11 +24,12 @@ export class DemandeOpCommercialComponent implements OnInit, OnDestroy {
opCommDataBloquer: FirebaseListObservable<any[]>;
profileData: FirebaseListObservable<any[]>;
commercant: Commercant;
databaseRef: any;
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService, private opComService: OpCommercialService) {
this.opComm = new OperationCommerciale();
this.databaseRef = firebase.database().ref();
this.user = afAuth.authState;
this.commercant = new Commercant();
this.user.subscribe(
@ -45,7 +46,7 @@ export class DemandeOpCommercialComponent implements OnInit, OnDestroy {
this.opCommDataBloquer = this.afDb.list('/OperationCommercial/',{
query: {
orderByChild: 'validationXJC',
equalTo: 'Bloquer'
equalTo: 'Rejeté'
}
}).map((array) => array.reverse()) as FirebaseListObservable<any[]>;
}
@ -53,6 +54,15 @@ export class DemandeOpCommercialComponent implements OnInit, OnDestroy {
}
);
}
rejeter(){
const opEnvRef = this.databaseRef.child('OperationCommercial').child('validationXJC');
opEnvRef.set('Rejeté');
}
valider(){
const opEnvRef = this.databaseRef.child('OperationCommercial').child('validationXJC');
opEnvRef.set('Validé');
}
ngOnInit() {
try {

@ -24,6 +24,7 @@ export class ListeOpCommercialComponent implements OnInit, OnDestroy {
profileData: FirebaseListObservable<any[]>;
commercant: Commercant;
constructor(public afAuth: AngularFireAuth, public afDb: AngularFireDatabase,
private router: Router, private authService: AuthService, private opComService: OpCommercialService) {
this.opComm = new OperationCommerciale();
@ -41,6 +42,7 @@ export class ListeOpCommercialComponent implements OnInit, OnDestroy {
);
}
ngOnInit() {
try {
this.user.subscribe(

Loading…
Cancel
Save