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

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

const SIGNIN_URL = environment.apiUrl + '/api/account/signin';

@Injectable()
export class SigninService {

	constructor(private http: HttpClient) {}

	signin(user: User): Observable<User> {
		return this.http.post<User>(SIGNIN_URL, user);
	}
}
