]>
Commit | Line | Data |
---|---|---|
e306af50 TL |
1 | import { HttpClient } from '@angular/common/http'; |
2 | import { Injectable } from '@angular/core'; | |
3 | ||
e306af50 | 4 | @Injectable({ |
f67539c2 | 5 | providedIn: 'root' |
e306af50 TL |
6 | }) |
7 | export class TelemetryService { | |
8 | private url = 'api/telemetry'; | |
9 | ||
10 | constructor(private http: HttpClient) {} | |
11 | ||
12 | getReport() { | |
13 | return this.http.get(`${this.url}/report`); | |
14 | } | |
15 | ||
16 | enable(enable: boolean = true) { | |
17 | const body = { enable: enable }; | |
18 | if (enable) { | |
19 | body['license_name'] = 'sharing-1-0'; | |
20 | } | |
21 | return this.http.put(`${this.url}`, body); | |
22 | } | |
23 | } |