import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { URL } from '../mocks/url';

@Injectable({
    providedIn: 'root'
})
export class AdvertisementService {
    constructor(
		private http: HttpClient
    ) { }
    
    async getAdvertisement(adv_id: any) {
		const httpOptions = {
			headers: new HttpHeaders({
				'Access-Control-Allow-Origin': '*',
				'Content-Type': 'application/json',
				'Authorization': 'Bearer ' + localStorage.access_Token
			})
		};

		return await this.http.get(URL + '/api/maioraservice/advertisement/v1/adv_id/' + adv_id, httpOptions).toPromise();
	}
}
