Update MMDService.ts

Simplified the `GetTermsAsDropdownOptions` method
This commit is contained in:
Anoop Tatti 2020-08-24 16:20:00 +01:00 committed by GitHub
parent 14eb43106d
commit 352182bfa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 12 deletions

View File

@ -16,17 +16,11 @@ export class MMDService {
if (requiredOptionsFromCache.length) {
options = requiredOptionsFromCache.map(r => ({ key: r.key, text: r.text }));
return options;
} else {
//Get from Graph
return await this._getTermsAsDropdownOptionsUsingGraph(apiUrl, parent);
}
} else {
//Get from Graph
return await this._getTermsAsDropdownOptionsUsingGraph(apiUrl, parent);
}
} else {
return await this._getTermsAsDropdownOptionsUsingGraph(apiUrl, parent);
}
}
}
}
//Get data using Graph
return await this._getTermsAsDropdownOptionsUsingGraph(apiUrl, parent);
}
private static async _getTermsAsDropdownOptionsUsingGraph(apiUrl: string, parent: string): Promise<IDropdownOption[]> {
@ -68,4 +62,4 @@ export class MMDService {
}
return result;
}
}
}