🐛 Fix pin service

search-pin
Alexis Feron 3 months ago
parent fc23aca65e
commit 0f9d09495f

@ -9,7 +9,7 @@ import { AutocompleteService } from './auto-complete.service';
})
export class PinService {
private apiURL = environment.apiURL;
private token = localStorage.getItem('auth_token');
constructor(
private http: HttpClient,
private autoCompleteService: AutocompleteService
@ -19,7 +19,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 });
}
@ -33,7 +33,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) => {

Loading…
Cancel
Save