UI: added TrendzSettingsService to Services Map

This commit is contained in:
yuliaklochai 2025-05-06 09:27:29 +03:00
parent f6bb9be780
commit 338d81e6c1
4 changed files with 10 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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