100. Register service call (#12)
This commit is contained in:
@ -3,6 +3,7 @@ import {environment} from "../../environments/environment";
|
|||||||
import {HttpClient, HttpErrorResponse, HttpResponse} from "@angular/common/http";
|
import {HttpClient, HttpErrorResponse, HttpResponse} from "@angular/common/http";
|
||||||
import {UserLogin} from "../dto/user-login";
|
import {UserLogin} from "../dto/user-login";
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from "rxjs";
|
||||||
|
import {User} from "../model/user";
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -19,5 +20,9 @@ export class AuthenticationService {
|
|||||||
(`${this.host}/user/login`, userDto, {observe: 'response'});
|
(`${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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user