/**
* @file Roles Deatils component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
});
this.dataSource.load(this.roleData).then((data: boolean) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
return {
name: roleData.name,
identifier: roleData._id,
- modified: this.sharedService.convertEpochTime(Number(roleData._admin.modified)),
- created: this.sharedService.convertEpochTime(Number(roleData._admin.created)),
+ modified: this.sharedService.convertEpochTime(!isNullOrUndefined(roleData._admin) ? Number(roleData._admin.modified) : null),
+ created: this.sharedService.convertEpochTime(!isNullOrUndefined(roleData._admin) ? Number(roleData._admin.created) : null),
permissions: roleData.permissions
};
}
public ngOnDestroy(): void {
this.generateDataSub.unsubscribe();
}
-
}