Browse Source

UI: added TrendzSettingsService to Services Map

pull/13301/head
yuliaklochai 1 year ago
parent
commit
338d81e6c1
  1. 1
      ui-ngx/src/app/core/http/public-api.ts
  2. 10
      ui-ngx/src/app/core/http/trendz-settings.service.ts
  3. 4
      ui-ngx/src/app/modules/home/models/services.map.ts
  4. 1
      ui-ngx/src/app/shared/models/public-api.ts

1
ui-ngx/src/app/core/http/public-api.ts

@ -47,3 +47,4 @@ export * from './user.service';
export * from './user-settings.service'; export * from './user-settings.service';
export * from './widget.service'; export * from './widget.service';
export * from './usage-info.service'; export * from './usage-info.service';
export * from './trendz-settings.service'

10
ui-ngx/src/app/core/http/trendz-settings.service.ts

@ -18,7 +18,7 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { TrendzSettings } from '@shared/models/trendz-settings.models'; import { TrendzSettings } from '@shared/models/trendz-settings.models';
import { defaultHttpOptionsFromConfig } from '@core/http/http-utils'; import { defaultHttpOptionsFromConfig, RequestConfig } from '@core/http/http-utils';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
@ -29,11 +29,11 @@ export class TrendzSettingsService {
private http: HttpClient private http: HttpClient
) {} ) {}
public getTrendzSettings(): Observable<TrendzSettings> { public getTrendzSettings(config?: RequestConfig): Observable<TrendzSettings> {
return this.http.get<TrendzSettings>(`/api/trendz/settings`, defaultHttpOptionsFromConfig({ignoreLoading: true, ignoreErrors: true})) return this.http.get<TrendzSettings>(`/api/trendz/settings`, defaultHttpOptionsFromConfig(config))
} }
public saveTrendzSettings(trendzSettings: TrendzSettings): Observable<TrendzSettings> { public saveTrendzSettings(trendzSettings: TrendzSettings, config?: RequestConfig): Observable<TrendzSettings> {
return this.http.post<TrendzSettings>(`/api/trendz/settings`, trendzSettings, defaultHttpOptionsFromConfig({ignoreLoading: true, ignoreErrors: true})) return this.http.post<TrendzSettings>(`/api/trendz/settings`, trendzSettings, defaultHttpOptionsFromConfig(config))
} }
} }

4
ui-ngx/src/app/modules/home/models/services.map.ts

@ -52,6 +52,7 @@ import { UiSettingsService } from '@core/http/ui-settings.service';
import { UsageInfoService } from '@core/http/usage-info.service'; import { UsageInfoService } from '@core/http/usage-info.service';
import { EventService } from '@core/http/event.service'; import { EventService } from '@core/http/event.service';
import { AuditLogService } from '@core/http/audit-log.service'; import { AuditLogService } from '@core/http/audit-log.service';
import { TrendzSettingsService } from '@core/http/trendz-settings.service';
export const ServicesMap = new Map<string, Type<any>>( export const ServicesMap = new Map<string, Type<any>>(
[ [
@ -91,6 +92,7 @@ export const ServicesMap = new Map<string, Type<any>>(
['usageInfoService', UsageInfoService], ['usageInfoService', UsageInfoService],
['notificationService', NotificationService], ['notificationService', NotificationService],
['eventService', EventService], ['eventService', EventService],
['auditLogService', AuditLogService] ['auditLogService', AuditLogService],
['trendzSettingsService', TrendzSettingsService]
] ]
); );

1
ui-ngx/src/app/shared/models/public-api.ts

@ -62,3 +62,4 @@ export * from './window-message.model';
export * from './usage.models'; export * from './usage.models';
export * from './query/query.models'; export * from './query/query.models';
export * from './regex.constants'; export * from './regex.constants';
export * from './trendz-settings.models'

Loading…
Cancel
Save