F: implemented config service in other services

This commit is contained in:
X4Lo committed 2025-02-15 23:57:39 +01:00
1 parent 13f68fcac6
commit cfda451f71
16 files changed
+84 -103

No files matched your search

@@ -2,16 +2,18 @@ import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { EpisodeSeen } from '../../shared/models/episode-seen.model';
import { EpisodeSeenDto } from '../../shared/models/dtos/episode-seen.dto';
import { environment } from '../../../environments/environment.prod';
import { ConfigService } from './config.service';
@Injectable({
providedIn: 'root',
})
export class EpisodeSeenService {
private backend_apiUrl = environment.API_URL;
private backend_apiUrl;
private apiAction = 'episode-seen';
constructor(private http: HttpClient) {}
constructor(private http: HttpClient, private configService: ConfigService) {
this.backend_apiUrl = this.configService.getBackendApiUrl();
}
createEpisodeSeen(
entryId: number,
@@ -59,5 +61,4 @@ export class EpisodeSeenService {
`${this.backend_apiUrl}/${this.apiAction}/${id}`
);
}
}