Browse Source

Minor simplification of using angulars $q service.

jalbr74 6 years ago
parent
commit
e92bc4a7ec
1 changed files with 3 additions and 7 deletions
  1. 3 7
      client/src/services/peoplesearch-config.service.ts

+ 3 - 7
client/src/services/peoplesearch-config.service.ts

@@ -81,9 +81,7 @@ export default class PeopleSearchConfigService
     }
 
     personDetailsConfig(): IPromise<IPersonDetailsConfig> {
-        const deffered: IDeferred<IPersonDetailsConfig> = this.$q.defer();
-
-        this.$q.all([
+        return this.$q.all([
             this.getValue(PHOTO_ENABLED),
             this.getValue(ORGCHART_ENABLED),
             this.getValue(EXPORT_ENABLED),
@@ -91,17 +89,15 @@ export default class PeopleSearchConfigService
             this.getValue(MAILTO_ENABLED),
             this.getValue(MAILTO_MAX_DEPTH),
         ]).then((results: any[]) => {
-            deffered.resolve({
+            return {
                 photosEnabled: results[0],
                 orgChartEnabled: results[1],
                 exportEnabled: results[2],
                 maxExportDepth: results[3],
                 emailTeamEnabled: results[4],
                 maxEmailDepth: results[5]
-            })
+            }
         });
-
-        return deffered.promise;
     }
 
     advancedSearchConfig(): IPromise<IAdvancedSearchConfig> {