@@ -91,10 +91,15 @@ export class SubmissionRestService {
9191 * The identifier for the object
9292 * @param collectionId
9393 * The owning collection for the object
94+ * @param projections
9495 */
95- protected getEndpointByIDHref ( endpoint , resourceID , collectionId ?: string ) : string {
96+ protected getEndpointByIDHref ( endpoint , resourceID , collectionId ?: string , projections : string [ ] = [ ] ) : string {
9697 let url = isNotEmpty ( resourceID ) ? `${ endpoint } /${ resourceID } ` : `${ endpoint } ` ;
9798 url = new URLCombiner ( url , '?embed=item,sections,collection' ) . toString ( ) ;
99+
100+ projections . forEach ( ( projection ) => {
101+ url = new URLCombiner ( url , '&projection=' + projection ) . toString ( ) ;
102+ } ) ;
98103 if ( collectionId ) {
99104 url = new URLCombiner ( url , `&owningCollection=${ collectionId } ` ) . toString ( ) ;
100105 }
@@ -135,9 +140,9 @@ export class SubmissionRestService {
135140 * @return Observable<SubmitDataResponseDefinitionObject>
136141 * server response
137142 */
138- public getDataById ( linkName : string , id : string , useCachedVersionIfAvailable = false ) : Observable < SubmitDataResponseDefinitionObject > {
143+ public getDataById ( linkName : string , id : string , useCachedVersionIfAvailable = false , projections : string [ ] = [ ] ) : Observable < SubmitDataResponseDefinitionObject > {
139144 return this . halService . getEndpoint ( linkName ) . pipe (
140- map ( ( endpointURL : string ) => this . getEndpointByIDHref ( endpointURL , id ) ) ,
145+ map ( ( endpointURL : string ) => this . getEndpointByIDHref ( endpointURL , id , null , projections ) ) ,
141146 filter ( ( href : string ) => isNotEmpty ( href ) ) ,
142147 distinctUntilChanged ( ) ,
143148 mergeMap ( ( endpointURL : string ) => {
0 commit comments