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

import { environment } from '../../environments/environment';

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

    constructor(private http: HttpClient) {
    }

    register(userModel) {
        return this.http.post(environment.apiUrl + "/users", userModel);
    }

    checkModel(userModel) {
        return this.http.post(environment.apiUrl + "/users/model", userModel);
    }

    password(passwordModel) {
        return this.http.patch(environment.apiUrl + "/users/password", passwordModel);
    }

    update(userModel) {
        return this.http.patch(environment.apiUrl + "/users", userModel);
    }
}