From 9856d2db53a925f946cb3f0935689e116d5ee741 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 11 Mar 2018 12:00:54 -0600 Subject: [PATCH] web-ui: Add TransactionsService --- web-ui/src/app/app.module.ts | 4 +++- .../src/app/services/transactions.service.ts | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 web-ui/src/app/services/transactions.service.ts diff --git a/web-ui/src/app/app.module.ts b/web-ui/src/app/app.module.ts index 9c194c9..e8380fb 100644 --- a/web-ui/src/app/app.module.ts +++ b/web-ui/src/app/app.module.ts @@ -14,6 +14,7 @@ import { NgHttpLoaderModule } from 'ng-http-loader/ng-http-loader.module' import { LanguageService } from './services/language.service'; import { NotificationService } from './services/notification.service'; +import { TransactionsService } from './services/transactions.service'; import { AppComponent } from './app.component'; import { HomeComponent } from './components/home/home.component'; @@ -50,7 +51,8 @@ import { TransactionFinderComponent } from './components/transaction-finder/tran ], providers: [ LanguageService, - NotificationService + NotificationService, + TransactionsService ], bootstrap: [AppComponent] }) diff --git a/web-ui/src/app/services/transactions.service.ts b/web-ui/src/app/services/transactions.service.ts new file mode 100644 index 0000000..053c289 --- /dev/null +++ b/web-ui/src/app/services/transactions.service.ts @@ -0,0 +1,22 @@ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { Observable } from 'rxjs/Observable'; + +import { environment } from '../../environments/environment'; + +const httpOptions = { + headers: new HttpHeaders({ 'Content-Type': 'application/json' }) +}; + +@Injectable() +export class TransactionsService { + + private baseUrl = environment.api.url + '/transactions'; + + constructor(private http: HttpClient) { } + + verifyEmail(txid: string): Observable { + const url = this.baseUrl + txid; + return this.http.get(url); + } +}