99. Creating user class (#12)
This commit is contained in:
7
support-portal-frontend/src/app/model/user.spec.ts
Normal file
7
support-portal-frontend/src/app/model/user.spec.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import {User} from './user';
|
||||||
|
|
||||||
|
describe('User', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
expect(new User()).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
15
support-portal-frontend/src/app/model/user.ts
Normal file
15
support-portal-frontend/src/app/model/user.ts
Normal 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;
|
||||||
|
}
|
||||||
@ -15,7 +15,8 @@ export class AuthenticationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public login(userDto: UserLogin): Observable<HttpResponse<any> | HttpErrorResponse> {
|
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'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user