import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs/Observable';
import { PasswordWrapper } from '../../core/entities';
import { environment } from '../../../environments/environment';

const ACCOUNT_URL = environment.apiUrl + '/api/account';

@Injectable()
export class ChangePasswordService {

	constructor(private http: HttpClient) {}

	changePassword(passwordWrapper: PasswordWrapper): Observable<any> {
		return this.http.put(ACCOUNT_URL + '/changePassword', passwordWrapper);
	}
}
