mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Fix issue with REFRESH_USER_SUGGESTIONS action
This commit is contained in:
@@ -19,7 +19,6 @@ import {
|
||||
RetrieveAuthenticatedEpersonSuccessAction,
|
||||
} from '../../core/auth/auth.actions';
|
||||
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 { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||
import { SuggestionsService } from '../suggestions.service';
|
||||
@@ -89,10 +88,10 @@ export class SuggestionTargetsEffects {
|
||||
refreshUserSuggestionsAction$ = createEffect(() => this.actions$.pipe(
|
||||
ofType(SuggestionTargetActionTypes.REFRESH_USER_SUGGESTIONS),
|
||||
switchMap(() => {
|
||||
return this.store$.select((state: any) => state.core.auth.user)
|
||||
return this.store$.select((state: any) => state.core.auth.userId)
|
||||
.pipe(
|
||||
switchMap((user: EPerson) => {
|
||||
return this.suggestionsService.retrieveCurrentUserSuggestions(user.uuid)
|
||||
switchMap((userId: string) => {
|
||||
return this.suggestionsService.retrieveCurrentUserSuggestions(userId)
|
||||
.pipe(
|
||||
map((suggestionTargets: SuggestionTarget[]) => new AddUserSuggestionsAction(suggestionTargets)),
|
||||
catchError((error: unknown) => {
|
||||
|
Reference in New Issue
Block a user