source: bus-n-go-pavel-216049/bus-n-go-frontend/src/app/services/user/user.service.ts@ dedbf60

Last change on this file since dedbf60 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
RevLine 
[baf4cc4]1import { Injectable } from '@angular/core';
2import {HttpClient} from "@angular/common/http";
3import {Observable} from "rxjs";
4import {UserResponse} from "../../model/responses/UserResponse";
5
6@Injectable({
7 providedIn: 'root'
8})
9export 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.