Skip to content

Commit

Permalink
[issue-9355] fix error on e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescoMolinaro committed Feb 22, 2024
1 parent dcf5836 commit 10e8768
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/app/suggestion-notifications/suggestions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { hasValue, isNotEmpty } from '../shared/empty.util';
import { ResearcherProfile } from '../core/profile/model/researcher-profile.model';
import {
getAllSucceededRemoteDataPayload,
getFinishedRemoteData,
getFinishedRemoteData, getFirstCompletedRemoteData,
getFirstSucceededRemoteDataPayload,
getFirstSucceededRemoteListPayload
} from '../core/shared/operators';
Expand Down Expand Up @@ -155,10 +155,10 @@ export class SuggestionsService {
*/
public retrieveCurrentUserSuggestions(userUuid: string): Observable<SuggestionTarget[]> {
return this.researcherProfileService.findById(userUuid, true).pipe(
getFirstSucceededRemoteDataPayload(),
mergeMap((profile: ResearcherProfile) => {
if (isNotEmpty(profile)) {
return this.researcherProfileService.findRelatedItemId(profile).pipe(
getFirstCompletedRemoteData(),
mergeMap((profile: RemoteData<ResearcherProfile> ) => {
if (isNotEmpty(profile) && profile.hasSucceeded && isNotEmpty(profile.payload)) {
return this.researcherProfileService.findRelatedItemId(profile.payload).pipe(

Check warning on line 161 in src/app/suggestion-notifications/suggestions.service.ts

View check run for this annotation

Codecov / codecov/patch

src/app/suggestion-notifications/suggestions.service.ts#L161

Added line #L161 was not covered by tests
mergeMap((itemId: string) => {
return this.suggestionsDataService.getTargetsByUser(itemId).pipe(
getFirstSucceededRemoteListPayload()
Expand All @@ -169,7 +169,7 @@ export class SuggestionsService {
return of([]);
}
}),
take(1)
catchError(() => of([]))

Check warning on line 172 in src/app/suggestion-notifications/suggestions.service.ts

View check run for this annotation

Codecov / codecov/patch

src/app/suggestion-notifications/suggestions.service.ts#L172

Added line #L172 was not covered by tests
);
}

Expand Down

0 comments on commit 10e8768

Please sign in to comment.