From 0da71c25e49853b029194c453e3d0f1a3723f4c7 Mon Sep 17 00:00:00 2001 From: gbols Date: Tue, 25 Jun 2019 15:54:34 +0100 Subject: [PATCH] admin is able to view department details [Finishes #165053196] --- src/components/Departments/DepartmentDetailComponent.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Departments/DepartmentDetailComponent.jsx b/src/components/Departments/DepartmentDetailComponent.jsx index 198f940c..4efd1f72 100644 --- a/src/components/Departments/DepartmentDetailComponent.jsx +++ b/src/components/Departments/DepartmentDetailComponent.jsx @@ -19,7 +19,7 @@ export class DepartmentDetailComponent extends React.Component { assetsAssigned = (assets) => { - if (isEmpty(assets.assets_assigned)) { + if (isEmpty(assets.assets_assigned.result)) { return ( @@ -38,6 +38,8 @@ export class DepartmentDetailComponent extends React.Component { render() { const { isLoading, details } = this.props; + // eslint-disable-next-line camelcase + const { name, assets_assigned } = details; if (isLoading) { return ( @@ -67,10 +69,10 @@ export class DepartmentDetailComponent extends React.Component {
- Department Name: {details.name || 'Not Provided'} + Department Name: {name || 'Not Provided'}
- Total Assets Assigned: {details.assets_assigned.length} + Total Assets Assigned: {assets_assigned.results.length}
{this.assetsAssigned(details)}