Skip to content

Commit

Permalink
Remove as'd typings from the cf entity generator
Browse files Browse the repository at this point in the history
  • Loading branch information
KlapTrap committed Sep 4, 2019
1 parent 307d71a commit b9da90f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/frontend/packages/cloud-foundry/src/cf-entity-generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function generateCFQuotaDefinitionEntity(endpointDefinition: StratosEndpointExte
}

function generateCFAppEnvVarEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition = {
const definition: IStratosEntityDefinition<any, APIResource, any> = {
type: appEnvVarsEntityType,
schema: cfEntityFactory(appEnvVarsEntityType),
endpoint: endpointDefinition,
Expand All @@ -226,21 +226,21 @@ function generateCFAppEnvVarEntity(endpointDefinition: StratosEndpointExtensionD
getPaginationParameters: (page: number) => ({ page: '1' })
},
successfulRequestDataMapper: (data, endpointGuid, guid, entityType, endpointType, action) => {
if (data) {
return {
entity: {
...data,
cfGuid: endpointGuid
},
metadata: {
guid: action.guid
}
};
}
return {};
return {
entity: {
...(data || {}),
cfGuid: endpointGuid
},
metadata: {
guid: action.guid,
created_at: '',
updated_at: '',
url: ''
}
};
},
// TODO: we need a envvar type
} as IStratosEntityDefinition<any, APIResource, any>;
};
return new StratosCatalogueEntity<IFavoriteMetadata, APIResource>(definition, {
dataReducers: [
endpointDisconnectRemoveEntitiesReducer()
Expand Down Expand Up @@ -358,7 +358,7 @@ function generateCFUserProvidedServiceInstanceEntity(endpointDefinition: Stratos
}

function generateCFAppStatsEntity(endpointDefinition: StratosEndpointExtensionDefinition) {
const definition = {
const definition: IStratosEntityDefinition<any, AppStat> = {
type: appStatsEntityType,
schema: cfEntityFactory(appStatsEntityType),
endpoint: endpointDefinition,
Expand Down Expand Up @@ -386,7 +386,7 @@ function generateCFAppStatsEntity(endpointDefinition: StratosEndpointExtensionDe
}
return data;
},
} as IStratosEntityDefinition<any, AppStat>;
};
return new StratosCatalogueEntity<IFavoriteMetadata, AppStat>(definition, {
dataReducers: [
endpointDisconnectRemoveEntitiesReducer()
Expand Down

0 comments on commit b9da90f

Please sign in to comment.