|
|
|
@ -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 {
|
|
|
|
|