Skip to content

Commit

Permalink
admin is able to view department details [Finishes #165053196]
Browse files Browse the repository at this point in the history
  • Loading branch information
gbols committed Jun 25, 2019
1 parent 366a69b commit 0da71c2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/Departments/DepartmentDetailComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class DepartmentDetailComponent extends React.Component {


assetsAssigned = (assets) => {
if (isEmpty(assets.assets_assigned)) {
if (isEmpty(assets.assets_assigned.result)) {
return (
<Card>
<Card.Content extra>
Expand All @@ -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 (
<LoaderComponent />
Expand Down Expand Up @@ -67,10 +69,10 @@ export class DepartmentDetailComponent extends React.Component {
<Grid columns={3} relaxed="very" stackable>
<Grid.Column>
<Header>
Department Name: {details.name || 'Not Provided'}
Department Name: {name || 'Not Provided'}
</Header>
<Header>
Total Assets Assigned: {details.assets_assigned.length}
Total Assets Assigned: {assets_assigned.results.length}
</Header>
{this.assetsAssigned(details)}
</Grid.Column>
Expand Down

0 comments on commit 0da71c2

Please sign in to comment.