import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { User } from '../models/user';

@Injectable({
  providedIn: 'root'
})
export class UserService {

  constructor() { }

  private http = inject(HttpClient)

  getUser(){
    return this.http.get<User>("http://localhost:8080/users/pera")
  }

  getAllUsers(){
    return this.http.get<User[]>("http://localhost:8080/users")
  }
}
