diff --git a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/pages/user-representation/user-representation.component.ts b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/pages/user-representation/user-representation.component.ts index 03e6e5f..3ae9689 100644 --- a/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/pages/user-representation/user-representation.component.ts +++ b/DigitalData.UserManager.API/ClientApp/user_manager_ui/src/app/pages/user-representation/user-representation.component.ts @@ -59,31 +59,24 @@ export class UserRepresentationComponent extends BasePageComponent implements Af @ViewChild("repGroups") repGroups!: GroupTableComponent; @ViewChild("userReps") userReps!: UserRepTableComponent; - userGroupOnSelectedRows = (rows: GuiSelectedRow[], isUser: boolean = true) => { + userOnSelectedRows = (rows: GuiSelectedRow[]) => { if (rows.length > 0) { - if (isUser) { - this.useRepLabel = `Vertretungen von ${rows[0].source?.username}` - this.users.safelyUnselectAll(); - this.userReps.fetchData(rows[0].source?.id) - this.slGroupId = undefined; - this.slUserId = rows[0].source?.id - } - else { - this.useRepLabel = `Vertretungen von ${rows[0].source?.name}` - this.groups.safelyUnselectAll(); - this.userReps.fetchData(undefined, rows[0].source?.id) - this.slUserId = undefined; - this.slGroupId = rows[0].source?.id - } + this.useRepLabel = `Vertretungen von ${rows[0].source?.username}` + this.users.safelyUnselectAll(); + this.userReps.fetchData(rows[0].source?.id) + this.slGroupId = undefined; + this.slUserId = rows[0].source?.id } } - userOnSelectedRows = (rows: GuiSelectedRow[]) => { - this.userGroupOnSelectedRows(rows, true); - } - groupOnSelectedRows = (rows: GuiSelectedRow[]) => { - this.userGroupOnSelectedRows(rows, false); + if (rows.length > 0) { + this.useRepLabel = `Vertretungen von ${rows[0].source?.name}` + this.groups.safelyUnselectAll(); + this.userReps.fetchData(undefined, rows[0].source?.id) + this.slUserId = undefined; + this.slGroupId = rows[0].source?.id + } } repUserOnSelectedRows = (rows: GuiSelectedRow[]) => { @@ -213,4 +206,4 @@ export class UserRepresentationComponent extends BasePageComponent implements Af this.slUserRepId = rows[0].source?.id; } } -} \ No newline at end of file +}