summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/sql/sql.service.ts
blob: bfebcd9db3cb8178001533f3e447e40d687ddf54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from '../../../../../../environments/environment';

@Injectable({
  providedIn: 'root'
})
export class SqlService {

  constructor(private _http : HttpClient) { }

  getSQLTabData(reportId : string) : Observable<any>
  {
    return this._http.get(environment.baseUrl + "report/wizard/retrieve_sql_tab_wise_data/" + reportId, { headers: new HttpHeaders({'Content-Type': 'application/json'})})

  }  

  postSQLValidateAndSave(sqlText : string ) : Observable<any>
  {
    return this._http.post(environment.baseUrl + "report/wizard/retrieve_data/true", 
    {
      "query": sqlText,
      "tabId": "Sql",
      "tabName": "Sql"
    } 
    , { headers: new HttpHeaders({'Content-Type': 'application/json'})});
  }
}