parent
941e46feb6
commit
3955f44590
@ -1,7 +1,6 @@
|
||||
export interface Monument {
|
||||
coords: number[];
|
||||
name: string;
|
||||
images: string[];
|
||||
location: number[];
|
||||
title: string;
|
||||
files: string[];
|
||||
description: string;
|
||||
visited: boolean;
|
||||
}
|
||||
|
@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { GetPinService } from './get-pin.service';
|
||||
|
||||
describe('GetPinService', () => {
|
||||
let service: GetPinService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(GetPinService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,21 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class GetPinService {
|
||||
private apiURL = environment.apiURL;
|
||||
private token = localStorage.getItem('auth_token');
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
getPins(): any {
|
||||
const url = `${this.apiURL}/pins`;
|
||||
const headers = new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.token,
|
||||
});
|
||||
return this.http.get<any>(url, { headers });
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiURL: 'http://127.0.0.1:8000/api/v1',
|
||||
apiURL: 'https://api.memorymap.fr/api/v1',
|
||||
};
|
||||
|
Loading…
Reference in new issue