I'm having an error with my typescript application that I'm building. I'm using Ionic/Angular and one of the errors I'm getting is:
[20:12:30] typescript: C:/xampp/htdocs/project x/anonymous-social/src/pages/activity/activity.ts, line: 59 Argument of type '(data: DataSnapshot) => void' is not assignable to parameter of type '(a: DataSnapshot) => boolean'. Type 'void' is not assignable to type 'boolean'.
L58: (snapshot) => {
L59: snapshot.forEach(data => {
L60: data.ref.update({'read': "true"})
I'm not really sure why I'm getting this to be honest. Maybe someone can explain.. The code it is referencing is:
if(checkStatus) {
this.database.database.ref('/users/'+this.userData.uid+'/replied_to')
.orderByChild('read')
.equalTo("false").once("value",
(snapshot) => {
snapshot.forEach(data => {
data.ref.update({'read': "true"})
});
});
}
This is syntactically correct isn't it? What am I doing wrong? Any help would be great! Thank you