import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { Observable } from 'rxjs';

import { User } from '../core/entities';

@Injectable()
export class LoginService {

  constructor(
    private http: HttpClient
  ) {}

  login(user: User): Observable<User> {
    return this.http.post<User>('/api/account/login', user);
  }
}
