Updated user service to use different endpoint
This commit is contained in:
@@ -1,22 +1,6 @@
|
||||
import { OrganizationResponse } from './api/organization.response.model';
|
||||
import { UserInfoResponse } from './api/user-info.response.model';
|
||||
import { mapResponseToOrganization, Organization } from './organization.model';
|
||||
import { mapResponseToRoles } from './role.model';
|
||||
import { UserInfo } from './user-info.model';
|
||||
import { Employee } from './employee.model';
|
||||
import { Organization } from './organization.model';
|
||||
|
||||
export interface User extends UserInfo {
|
||||
export interface User extends Employee {
|
||||
organizations: Organization[];
|
||||
}
|
||||
|
||||
export function mapUserApiResponseToUser(userInfo: UserInfoResponse, organizations: OrganizationResponse[]): User {
|
||||
const { id, firstName, lastName, roles } = userInfo;
|
||||
|
||||
return {
|
||||
id,
|
||||
firstName,
|
||||
lastName,
|
||||
fullName: `${firstName} ${lastName}`,
|
||||
roles: mapResponseToRoles(roles),
|
||||
organizations: organizations ? organizations.map(organization => mapResponseToOrganization(organization)) : [],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user