99. Creating user class (#12)

This commit is contained in:
Art
2021-09-12 11:55:10 +03:00
parent fa5c69952c
commit c28a787f00
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,7 @@
import {User} from './user';
describe('User', () => {
it('should create an instance', () => {
expect(new User()).toBeTruthy();
});
});

View File

@ -0,0 +1,15 @@
export class User {
userId: string;
firstName: string;
lastName: string;
username: string;
email: string;
profileImageUrl: string;
lastLoginDate: Date;
lastLoginDateDisplay: Date;
joinDate: Date;
role: string; //ROLE_USER, ROLE_ADMIN
authorities: string[];
isActive: boolean;
isNotLocked: boolean;
}

View File

@ -15,7 +15,8 @@ export class AuthenticationService {
}
public login(userDto: UserLogin): Observable<HttpResponse<any> | HttpErrorResponse> {
return this.httpClient.post<HttpResponse<any> | HttpErrorResponse>(`${this.host}/user/login`, userDto, {observe: 'response'});
return this.httpClient.post<HttpResponse<any> | HttpErrorResponse>
(`${this.host}/user/login`, userDto, {observe: 'response'});
}