2020-02-12 17:24:42 +01:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
import { environment } from 'environments/environment';
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { HttpResponse, HttpClient } from '@angular/common/http';
|
|
|
|
import { BaseHttpService } from '../http/base-http.service';
|
2020-03-26 17:44:12 +01:00
|
|
|
import { ConfigurationService } from '../configuration/configuration.service';
|
2020-02-12 17:24:42 +01:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class UserGuideService {
|
2020-03-26 17:44:12 +01:00
|
|
|
private userGuideUrl : string;
|
2020-02-12 17:24:42 +01:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
private translate: TranslateService,
|
|
|
|
private http: HttpClient,
|
2020-03-26 17:44:12 +01:00
|
|
|
private baseHttp: BaseHttpService,
|
|
|
|
private configurationService: ConfigurationService
|
|
|
|
) {
|
|
|
|
this.userGuideUrl = `${configurationService.server}userguide`;
|
|
|
|
}
|
2020-02-12 17:24:42 +01:00
|
|
|
|
|
|
|
public getUserGuide(): Observable<HttpResponse<Blob>> {
|
|
|
|
return this.http.get(`${this.userGuideUrl}/current`, { responseType: 'blob', observe: 'response', headers: {'Content-type': 'text/html',
|
|
|
|
'Accept': 'text/html',
|
2020-03-26 17:44:12 +01:00
|
|
|
'Access-Control-Allow-Origin': this.configurationService.app,
|
2020-02-12 17:24:42 +01:00
|
|
|
'Access-Control-Allow-Credentials': 'true'} });
|
|
|
|
}
|
|
|
|
|
2020-02-13 17:15:34 +01:00
|
|
|
public updateUserGuide(data: any): Observable<String> {
|
|
|
|
return this.http.post<string>(`${this.userGuideUrl}/current`, data);
|
|
|
|
}
|
|
|
|
|
2020-02-12 17:24:42 +01:00
|
|
|
}
|