Last change
on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago |
split group project and individual project into two separate folders
|
-
Property mode
set to
100644
|
File size:
572 bytes
|
Line | |
---|
1 | import { Injectable } from '@angular/core';
|
---|
2 | import {HttpClient} from "@angular/common/http";
|
---|
3 | import {Observable} from "rxjs";
|
---|
4 | import {UserResponse} from "../../model/responses/UserResponse";
|
---|
5 |
|
---|
6 | @Injectable({
|
---|
7 | providedIn: 'root'
|
---|
8 | })
|
---|
9 | export class UserService {
|
---|
10 | private _url= '/api/users'
|
---|
11 |
|
---|
12 | constructor(private _http: HttpClient) { }
|
---|
13 |
|
---|
14 | getUser(): Observable<UserResponse | undefined> {
|
---|
15 | return this._http.get<UserResponse>(`${this._url}`)
|
---|
16 | }
|
---|
17 |
|
---|
18 | getAllPassengers(): Observable<UserResponse[]> {
|
---|
19 | return this._http.get<UserResponse[]>(`${this._url}/passengers`)
|
---|
20 | }
|
---|
21 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.