2017-12-19 13:53:46 +01:00
|
|
|
import {Injectable} from '@angular/core';
|
2019-06-03 15:20:36 +02:00
|
|
|
import {HttpClient} from "@angular/common/http";
|
2021-06-22 10:04:38 +02:00
|
|
|
import {timeout} from "rxjs/operators";
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class HtmlProjectReportService {
|
|
|
|
|
2019-06-03 15:20:36 +02:00
|
|
|
constructor(private http: HttpClient ) {}
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2020-03-16 14:09:46 +01:00
|
|
|
getHTML(id: string, requestType:string, csvAPIURL: string ):any {
|
2018-02-05 14:14:59 +01:00
|
|
|
let url = csvAPIURL;
|
2020-03-16 14:09:46 +01:00
|
|
|
url += '?format=html&type='+requestType+'&fq=(' +
|
|
|
|
//'((oaftype exact result) and (resulttypeid exact "'+resultTypeId+'")) and
|
|
|
|
'(relprojectid exact "'+id+'"))';
|
2017-12-19 13:53:46 +01:00
|
|
|
|
2021-06-22 10:04:38 +02:00
|
|
|
return this.http.get(url,{responseType: 'text'}).pipe(timeout(10000));
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|