import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { IgissueDetailDto } from 'src/app/_dto/igissue-detail.dto'; import { IgissueSummaryDto } from 'src/app/_dto/igissue-summary.dto'; import { environment } from 'src/environments/environment'; import { apiUrl } from '../_resources/api-url.properties'; @Injectable({ providedIn: 'root' }) export class SupportService { constructor(private http: HttpClient, ) { } async getMasterData(apiEndUrl: string, filter?: string): Promise { return await this.http.get(`${environment.apiUrl}/${apiEndUrl}`).toPromise(); } async save(body: any): Promise { return await this.http.post(`${environment.apiUrl}/${apiUrl.issueTracker}`, body).toPromise(); } async getDetailMasterData(apiEndUrl: string, filter?: string): Promise { return await this.http.get(`${environment.apiUrl}/${apiEndUrl}/${filter}`).toPromise(); } async updateMasterData(apiEndurl: string, body: any): Promise { return await this.http.post(`${environment.apiUrl}/${apiEndurl}`, body).toPromise(); } async updateDetailData(apiEndUrl: string, body): Promise { return await this.http.post(`${environment.apiUrl}/${apiEndUrl}`, body).toPromise(); } async getImg(apiUrlEnd: string, imagePath: string) { return await this.http.get(`${environment.apiUrl}/${apiUrlEnd}/${imagePath}`, { responseType: 'blob' }).toPromise(); } }