Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanconstantinescu committed Jul 24, 2019
1 parent 5f4ed53 commit 94f3822
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/app/assets/assets-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const routes: Routes = [
{
path: 'detail/:assetId',
canActivate: [
fromGuards.LoadCountiesGuard,
fromGuards.AssetsGuard,
fromGuards.AssetDetailGuard,
fromGuards.LoadCountiesGuard,
fromGuards.LoadDefendantsGuard,
fromGuards.LoadAddressesGuard,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class Address extends AssetProperty {
floor: this.floor,
flatNo: this.flatNo,
description: this.description,
asset: this.asset.toJson(),
asset: this.asset ? this.asset.toJson() : undefined,
assetId: this.assetId,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class StorageSpace extends AssetProperty {
toJson(): IStorageSpace {
return {
id: this.id,
address: this.address.toJson(),
address: this.address ? this.address.toJson() : undefined,
name: this.name,
asset: this.asset.toJson(),
asset: this.asset ? this.asset.toJson() : undefined,
assetId: this.assetId,
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/store/effects/storage-spaces.effect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class StorageSpacesEffects {
.pipe(
ofType(storageSpaceActions.StorageSpaceActionTypes.CreateStorageSpaceSuccess),
map((action: storageSpaceActions.CreateStorageSpaceSuccess) => action.payload),
map((aStorageSpace: StorageSpace) => new assetPropertiesActions.DeleteProperty(aStorageSpace.getAsset().id))
map((aStorageSpace: StorageSpace) => new assetPropertiesActions.DeleteProperty(aStorageSpace.getAssetId()))
);

@Effect()
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/store/reducers/asset-properties.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function reducer(state = initialState, action: fromAssetProperties.AssetP
const theProperty: AssetProperty = action.payload as AssetProperty;
const entities = {
...state.entities,
[theProperty.getAsset().id]: theProperty,
[theProperty.getAssetId()]: theProperty,
};

return {
Expand All @@ -28,7 +28,7 @@ export function reducer(state = initialState, action: fromAssetProperties.AssetP
const theProperty: AssetProperty = action.payload as AssetProperty;
const entities = {
...state.entities,
[theProperty.getAsset().id]: theProperty,
[theProperty.getAssetId()]: theProperty,
};

return {
Expand Down

0 comments on commit 94f3822

Please sign in to comment.