parent
61a5acd811
commit
5da162fcb7
@ -1,16 +0,0 @@
|
|||||||
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();
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,21 +0,0 @@
|
|||||||
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,13 +1,13 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { AddPinService } from './add-pin.service';
|
import { PinService } from './pin.service';
|
||||||
|
|
||||||
describe('AddPinService', () => {
|
describe('PinService', () => {
|
||||||
let service: AddPinService;
|
let service: PinService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(AddPinService);
|
service = TestBed.inject(PinService);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
Loading…
Reference in new issue