@@ -86,6 +86,8 @@ import { ProfileService } from '../core/services/profile.service';
8686import { SedaService } from '../core/services/seda.service' ;
8787import { NgxUiLoaderService } from 'ngx-ui-loader' ;
8888import { tap } from 'rxjs/operators' ;
89+ import { ProfileType } from '../models/profile-type.enum' ;
90+ import { ProfileVersion } from '../models/profile-version.enum' ;
8991
9092@Component ( {
9193 selector : 'app-home' ,
@@ -143,7 +145,9 @@ export class MainComponent implements OnInit, OnDestroy {
143145 // Check for query params to create a new profile
144146 this . route . queryParams . subscribe ( ( queryParams ) => {
145147 if ( queryParams [ 'type' ] && queryParams [ 'version' ] ) {
146- this . createNewProfile ( queryParams [ 'type' ] , queryParams [ 'version' ] ) ;
148+ const type : ProfileType = queryParams ?. type ;
149+ const version : ProfileVersion = queryParams ?. version ;
150+ this . createNewProfile ( type , version ) ;
147151 } else {
148152 // No valid params, redirect to list
149153 this . router . navigate ( [ '/' ] , { skipLocationChange : false } ) ;
@@ -216,10 +220,10 @@ export class MainComponent implements OnInit, OnDestroy {
216220 } ) ;
217221 }
218222
219- private createNewProfile ( profileType : string , profileVersion : string ) {
223+ private createNewProfile ( profileType : ProfileType , profileVersion : ProfileVersion ) {
220224 this . loaderService . start ( ) ;
221225 this . profileService
222- . createProfile ( '/pastis/profile' , profileType as any , profileVersion as any )
226+ . createProfile ( profileType , profileVersion )
223227 . pipe (
224228 tap ( ( profileResponse ) => {
225229 this . uploadedProfileResponse = profileResponse ;
0 commit comments