@@ -24,7 +24,6 @@ import {
2424 tap ,
2525} from 'rxjs/operators' ;
2626
27- import { getAccessTokenRequestRoute } from '../../app-routing-paths' ;
2827import { AuthService } from '../../core/auth/auth.service' ;
2928import { ItemRequestDataService } from '../../core/data/item-request-data.service' ;
3029import { RemoteData } from '../../core/data/remote-data' ;
@@ -35,6 +34,8 @@ import {
3534 getFirstCompletedRemoteData ,
3635 getFirstSucceededRemoteDataPayload ,
3736} from '../../core/shared/operators' ;
37+ import { URLCombiner } from '../../core/url-combiner/url-combiner' ;
38+ import { getItemModuleRoute } from '../../item-page/item-page-routing-paths' ;
3839import { hasValue } from '../../shared/empty.util' ;
3940import { ThemedLoadingComponent } from '../../shared/loading/themed-loading.component' ;
4041import { NotificationsService } from '../../shared/notifications/notifications.service' ;
@@ -126,7 +127,12 @@ export class GrantRequestCopyComponent implements OnInit {
126127 // and appropriately created a token to use with a secure link instead of attaching file directly
127128 if ( rd . hasSucceeded && hasValue ( rd . payload . accessToken ) ) {
128129 this . sendAsAttachment = false ;
129- this . previewLinkOptions = getAccessTokenRequestRoute ( rd . payload . itemId , rd . payload . accessToken ) ;
130+ this . previewLinkOptions = {
131+ routerLink : new URLCombiner ( getItemModuleRoute ( ) , rd . payload . itemId ) . toString ( ) ,
132+ queryParams : {
133+ accessToken : rd . payload . accessToken ,
134+ } ,
135+ } ;
130136 this . previewLink = this . hardRedirectService . getCurrentOrigin ( )
131137 + this . previewLinkOptions . routerLink + '?accessToken=' + rd . payload . accessToken ;
132138 }
0 commit comments