on this code snippet, i am getting the error stated above as 'Argument of type 'boolean' is not assignable to parameter of type '(value: string, index: number) => ObservableInput'
onFileSelected(event: any, user: any){
this.crudservice.upload(event.target.files[0], `images/profile/${user.uid}`).pipe(
concatMap(res = > this.crudservice.updateProfileData({res}))
).subscribe()
}
more specifically this line:
res = > this.crudservice.updateProfileData({res})
I will leave this here for reference on the method being called:
updateProfileData(profileData: any){
const user = firebase.auth().currentUser
return of(user).pipe(
concatMap(user =>{
if(!user) throw new Error('Not Authenticated');
return updateProfile(user,profileData)
})
)
}
The problem is the space between = > in res = > this.crudservice.updateProfileData({res}). The function operator cannot have a space between otherwise it's an assignment with a greater-then boolean operation.
The following should work:
onFileSelected(event: any, user: any){
this.crudservice.upload(event.target.files[0], `images/profile/${user.uid}`).pipe(
// Fix here v
concatMap(res => this.crudservice.updateProfileData({res}))
).subscribe()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With