-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NRPT-690: Adding metric service, api calls, chart rendering (#812)
* NRPT-690: Adding metric service, api calls, chart rendering * Update roles
- Loading branch information
Showing
10 changed files
with
692 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 118 additions & 3 deletions
121
angular/projects/admin-nrpti/src/app/home/home.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
angular/projects/admin-nrpti/src/app/services/metric.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
|
||
import { ApiService } from './api.service'; | ||
|
||
@Injectable({ providedIn: 'root' }) | ||
export class MetricService { | ||
|
||
constructor(public apiService: ApiService, public http: HttpClient) { } | ||
|
||
public getMetric(code: string): Promise<any> { | ||
if (!code) { | ||
throw Error('MetricService - getMetric - missing required code param'); | ||
} | ||
|
||
const queryString = `metric/${code}/data`; | ||
return this.http.get<any>(`${this.apiService.pathAPI}/${queryString}`).toPromise(); | ||
} | ||
} | ||
|
Oops, something went wrong.