Skip to content

Commit

Permalink
fix(SetingsService): Put Dashboard entitlements on the correct object
Browse files Browse the repository at this point in the history
  • Loading branch information
jgodi committed May 30, 2018
1 parent d86cd46 commit 3a57681
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/services/SettingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ import { Staffing } from './Staffing';
* A Class that defines a service to grab settings from Bullhorn
*/
export class SettingService {
http: AxiosInstance;
http: AxiosInstance;

constructor() {
this.http = Staffing.http();
}
constructor() {
this.http = Staffing.http();
}

async getSettings(settings: string[]): Promise<{ [key: string]: any }> {
const response: AxiosResponse = await this.http.get(`settings/${settings.join()}`);
return response.data;
}
async getSettings(settings: string[]): Promise<{ [key: string]: any }> {
const response: AxiosResponse = await this.http.get(`settings/${settings.join()}`);
return response.data;
}

async getEntitlements(entity: string): Promise<string[]> {
const response: AxiosResponse = await this.http.get(`entitlements/${entity}`);
return response.data;
}
async getEntitlements(entity: string): Promise<string[]> {
const response: AxiosResponse = await this.http.get(`entitlements/${entity}`);
return response.data;
}

async getAllSettingsAndEntitlements(): Promise<BullhornAllSettingsAndEntitlementsResponse> {
const response: AxiosResponse = await this.http.get('services/Settings/allEntitlementsAndSettings');
const result: BullhornAllSettingsAndEntitlementsResponse = response.data;
if (result && result.dashboardEntitlements && result.entitlements) {
result.entitlements.DASHBOARD = result.dashboardEntitlements;
async getAllSettingsAndEntitlements(): Promise<BullhornAllSettingsAndEntitlementsResponse> {
const response: AxiosResponse = await this.http.get('services/Settings/allEntitlementsAndSettings');
const result: BullhornAllSettingsAndEntitlementsResponse = response.data;
if (result && result.dashboardEntitlements && result.entitlements) {
result.entitlements.Dashboard = result.dashboardEntitlements;
}
return result;
}
return result;
}
}

0 comments on commit 3a57681

Please sign in to comment.