@@ -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' ,
@@ -144,7 +146,9 @@ export class MainComponent implements OnInit, OnDestroy {
144146 // Check for query params to create a new profile
145147 this . route . queryParams . subscribe ( ( queryParams ) => {
146148 if ( queryParams [ 'type' ] && queryParams [ 'version' ] ) {
147- this . createNewProfile ( queryParams [ 'type' ] , queryParams [ 'version' ] ) ;
149+ const type : ProfileType = queryParams ?. type ;
150+ const version : ProfileVersion = queryParams ?. version ;
151+ this . createNewProfile ( type , version ) ;
148152 } else {
149153 // No valid params, redirect to list
150154 this . router . navigate ( [ '/' ] , { skipLocationChange : false } ) ;
@@ -217,10 +221,10 @@ export class MainComponent implements OnInit, OnDestroy {
217221 } ) ;
218222 }
219223
220- private createNewProfile ( profileType : string , profileVersion : string ) {
224+ private createNewProfile ( profileType : ProfileType , profileVersion : ProfileVersion ) {
221225 this . loaderService . start ( ) ;
222226 this . profileService
223- . createProfile ( '/pastis/profile' , profileType as any , profileVersion as any )
227+ . createProfile ( profileType , profileVersion )
224228 . pipe (
225229 tap ( ( profileResponse ) => {
226230 this . uploadedProfileResponse = profileResponse ;
0 commit comments