100. Register service call (#12)

This commit is contained in:
Art
2021-09-12 12:02:53 +03:00
parent c28a787f00
commit daf58bb1b5

View File

@ -3,6 +3,7 @@ import {environment} from "../../environments/environment";
import {HttpClient, HttpErrorResponse, HttpResponse} from "@angular/common/http";
import {UserLogin} from "../dto/user-login";
import {Observable} from "rxjs";
import {User} from "../model/user";
@Injectable({
providedIn: 'root'
@ -19,5 +20,9 @@ export class AuthenticationService {
(`${this.host}/user/login`, userDto, {observe: 'response'});
}
public register(user: User): Observable<User | HttpErrorResponse> {
return this.httpClient
.post<User | HttpErrorResponse>(`${this.host}/user/register`, user);
}
}