I need to get, from an observable, the first item in payload.result which type is avatar:
let result = this.fileService.getAvatarByUserId(2).pipe(
map((payload: Payload<FileModel[]>) => payload.result),
first((result: FileModel[]) => result.type == 'avatar')
);
But I get error that "is not assignable to type 'Observable'"
How to solve this?