|
|
@ -25,18 +25,20 @@ import { OrigineFormationDTO } from '../model/origineFormationDTO'; |
|
|
|
import { StatutFormationDTO } from '../model/statutFormationDTO'; |
|
|
|
import { StatutFormationDTO } from '../model/statutFormationDTO'; |
|
|
|
import { TypeFormationDTO } from '../model/typeFormationDTO'; |
|
|
|
import { TypeFormationDTO } from '../model/typeFormationDTO'; |
|
|
|
|
|
|
|
|
|
|
|
import { BASE_PATH, COLLECTION_FORMATS } from '../config/variables'; |
|
|
|
import { BASE_PATH, COLLECTION_FORMATS, URL_API } from '../config/variables'; |
|
|
|
import { Configuration } from '../config/configuration'; |
|
|
|
import { Configuration } from '../config/configuration'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable() |
|
|
|
@Injectable() |
|
|
|
export class FormationsService { |
|
|
|
export class FormationsService { |
|
|
|
|
|
|
|
|
|
|
|
protected basePath = 'https://localhost:44393/api'; |
|
|
|
protected basePath = URL_API; |
|
|
|
public defaultHeaders = new HttpHeaders(); |
|
|
|
public defaultHeaders = new HttpHeaders(); |
|
|
|
public configuration = new Configuration(); |
|
|
|
public configuration = new Configuration(); |
|
|
|
|
|
|
|
|
|
|
|
constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { |
|
|
|
constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { |
|
|
|
|
|
|
|
console.log("HERE"); |
|
|
|
|
|
|
|
console.log("c " + configuration); |
|
|
|
if (basePath) { |
|
|
|
if (basePath) { |
|
|
|
this.basePath = basePath; |
|
|
|
this.basePath = basePath; |
|
|
|
} |
|
|
|
} |
|
|
@ -477,10 +479,12 @@ export class FormationsService { |
|
|
|
let headers = this.defaultHeaders; |
|
|
|
let headers = this.defaultHeaders; |
|
|
|
|
|
|
|
|
|
|
|
// authentication (bearerAuth) required
|
|
|
|
// authentication (bearerAuth) required
|
|
|
|
|
|
|
|
console.log("config" + this.configuration.accessToken); |
|
|
|
if (this.configuration.accessToken) { |
|
|
|
if (this.configuration.accessToken) { |
|
|
|
const accessToken = typeof this.configuration.accessToken === 'function' |
|
|
|
const accessToken = typeof this.configuration.accessToken === 'function' |
|
|
|
? this.configuration.accessToken() |
|
|
|
? this.configuration.accessToken() |
|
|
|
: this.configuration.accessToken; |
|
|
|
: this.configuration.accessToken; |
|
|
|
|
|
|
|
console.log("token" + accessToken); |
|
|
|
headers = headers.set('Authorization', 'Bearer ' + accessToken); |
|
|
|
headers = headers.set('Authorization', 'Bearer ' + accessToken); |
|
|
|
} |
|
|
|
} |
|
|
|
// to determine the Accept header
|
|
|
|
// to determine the Accept header
|
|
|
|