|
|
|
@ -13,7 +13,7 @@ export class PinService {
|
|
|
|
|
filteredPins: Pin[] = [];
|
|
|
|
|
|
|
|
|
|
private apiURL = environment.apiURL;
|
|
|
|
|
private token = localStorage.getItem('auth_token');
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
private http: HttpClient,
|
|
|
|
|
private autoCompleteService: AutocompleteService
|
|
|
|
@ -23,7 +23,7 @@ export class PinService {
|
|
|
|
|
const url = `${this.apiURL}/pins`;
|
|
|
|
|
const headers = new HttpHeaders({
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
Authorization: 'Bearer ' + this.token,
|
|
|
|
|
Authorization: 'Bearer ' + localStorage.getItem('auth_token'),
|
|
|
|
|
});
|
|
|
|
|
return this.http.get<any>(url, { headers });
|
|
|
|
|
}
|
|
|
|
@ -37,7 +37,7 @@ export class PinService {
|
|
|
|
|
const url = `${this.apiURL}/pin/add`;
|
|
|
|
|
const headers = new HttpHeaders({
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
Authorization: 'Bearer ' + this.token,
|
|
|
|
|
Authorization: 'Bearer ' + localStorage.getItem('auth_token'),
|
|
|
|
|
});
|
|
|
|
|
return this.autoCompleteService.getAdressCoordinates(pin.location).pipe(
|
|
|
|
|
switchMap((response: any) => {
|
|
|
|
|