diff options
Diffstat (limited to 'catalog-ui/src/app/services')
-rw-r--r-- | catalog-ui/src/app/services/data-types-service.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/catalog-ui/src/app/services/data-types-service.ts b/catalog-ui/src/app/services/data-types-service.ts index 09ece87907..5d247a14d9 100644 --- a/catalog-ui/src/app/services/data-types-service.ts +++ b/catalog-ui/src/app/services/data-types-service.ts @@ -134,6 +134,21 @@ export class DataTypesService implements IDataTypesService { }); } + public findAllDataTypesByModelIncludingRoot = (modelName: string): Promise<Map<string, DataTypeModel>> => { + return new Promise<Map<string, DataTypeModel>>((resolve, reject) => { + this.fetchDataTypesByModel(modelName).then(response => { + const dataTypes = response.data; + const dataTypeMap = new Map<string, DataTypeModel>(); + for(const dataTypeKey of Object.keys(dataTypes)) { + dataTypeMap.set(dataTypeKey, new DataTypeModel(dataTypes[dataTypeKey])) + } + resolve(dataTypeMap); + }).catch(reason => { + reject(reason); + }); + }); + } + public getAllDataTypes = ():DataTypesMap => { return this.dataTypes; }; |