Merge branch 'main-fix-suggestion-target-error' of https://github.com/4Science/dspace-angular into update_latest_ang_17

This commit is contained in:
Tim Donohue
2024-06-18 13:46:32 -05:00

View File

@@ -19,7 +19,6 @@ import {
RetrieveAuthenticatedEpersonSuccessAction, RetrieveAuthenticatedEpersonSuccessAction,
} from '../../core/auth/auth.actions'; } from '../../core/auth/auth.actions';
import { PaginatedList } from '../../core/data/paginated-list.model'; import { PaginatedList } from '../../core/data/paginated-list.model';
import { EPerson } from '../../core/eperson/models/eperson.model';
import { SuggestionTarget } from '../../core/notifications/suggestions/models/suggestion-target.model'; import { SuggestionTarget } from '../../core/notifications/suggestions/models/suggestion-target.model';
import { NotificationsService } from '../../shared/notifications/notifications.service'; import { NotificationsService } from '../../shared/notifications/notifications.service';
import { SuggestionsService } from '../suggestions.service'; import { SuggestionsService } from '../suggestions.service';
@@ -89,10 +88,10 @@ export class SuggestionTargetsEffects {
refreshUserSuggestionsAction$ = createEffect(() => this.actions$.pipe( refreshUserSuggestionsAction$ = createEffect(() => this.actions$.pipe(
ofType(SuggestionTargetActionTypes.REFRESH_USER_SUGGESTIONS), ofType(SuggestionTargetActionTypes.REFRESH_USER_SUGGESTIONS),
switchMap(() => { switchMap(() => {
return this.store$.select((state: any) => state.core.auth.user) return this.store$.select((state: any) => state.core.auth.userId)
.pipe( .pipe(
switchMap((user: EPerson) => { switchMap((userId: string) => {
return this.suggestionsService.retrieveCurrentUserSuggestions(user.uuid) return this.suggestionsService.retrieveCurrentUserSuggestions(userId)
.pipe( .pipe(
map((suggestionTargets: SuggestionTarget[]) => new AddUserSuggestionsAction(suggestionTargets)), map((suggestionTargets: SuggestionTarget[]) => new AddUserSuggestionsAction(suggestionTargets)),
catchError((error: unknown) => { catchError((error: unknown) => {