Init webapp
This commit is contained in:
25
rossa-tech-cli/src/app/services/gameTitles.service.ts
Normal file
25
rossa-tech-cli/src/app/services/gameTitles.service.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Injectable } from "@angular/core";
|
||||
import { HttpClient, HttpHeaders } from "@angular/common/http";
|
||||
import { Observable } from "rxjs";
|
||||
|
||||
import { environment } from "../../environments/environment";
|
||||
import { LoginService } from "../auth/login.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: "root",
|
||||
})
|
||||
export class GameTitlesService {
|
||||
constructor(private http: HttpClient, private userService: LoginService) {}
|
||||
|
||||
public getAllGameTitles(): Observable<any> {
|
||||
let jwtToken: String = this.userService.getUserSecurityToken(),
|
||||
headers: HttpHeaders = new HttpHeaders({
|
||||
authorization: "bearer " + jwtToken,
|
||||
}),
|
||||
options = { headers: headers };
|
||||
return this.http.get<any>(
|
||||
environment.apiBaseUrl + "secure/allGameTitles",
|
||||
options
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user