Firebase angulafire search not linking with database -
i looking list of customers whom invite has been enabled through email. following ts alert:
invitecustomer(): void { let prompt = this.alertctrl.create({ title: 'invite customer', message: "customer invited join app.", inputs: [ { name: 'name', placeholder: "your customer's name", type: 'text' }, { name: 'mobile', placeholder: "your customer's mobile number", type: 'mobile' }, { name: 'email', placeholder: "your customer's email", type: 'email' }, ], buttons: [ { text: 'cancel', handler: data => { console.log('cancel clicked'); } }, { text: 'save', handler: data => { this.customerprovider.invitecustomer(data.name, data.mobile, data.email,this.retailerprofile.retailerid, this.retailerprofile.retailername).then( () => { let loading = this.loadingctrl.create(); loading.dismiss().then(()=> { this.customerprovider.getpendinginvitationlist(); }); } )} } ] } ); prompt.present();
}
this saves data correctly problem starts when want retrieve , conduct search invitation:
getinvitation(): void { const loading = this.loadingctrl.create(); if (!this.getinvitationform.valid){ console.log(this.getinvitationform.value); } else { this.authprovider.getretailerinvite(this.getinvitationform.value.email) .subscribe(invitesnapshot => { if (invitesnapshot){ this.invitation = invitesnapshot[0]; } else { console.log("no email found..."); } loading.dismiss().then( () => { this.nextslide(); }); }); } loading.present();
}
the authprovider ts:
getretailerinvite(email: string): firebaselistobservable<any> { return this.afdatabase.list('/invite', { query: { orderbychild: 'email', equalto: email, limittofirst: 1 } })
}
everytime request returns ‘not found’ … although email id exists in database in firebasei wanted understand wht missing? database reference or logic?
Comments
Post a Comment