changes
This commit is contained in:
@@ -2,8 +2,8 @@ import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpParams, HttpErrorResponse } from '@angular/common/http';
|
||||
import { Observable, throwError } from 'rxjs';
|
||||
import { catchError, tap } from 'rxjs/operators';
|
||||
import { AvisoDto, TvSettings } from './aviso.dto'; // Importiere das Interface
|
||||
import { AvisoTvTextSettingsDto } from './aviso-tv-settings.dto'; // Importiere das neue Interface
|
||||
import { AvisoDto, TvSettings } from './aviso.dto';
|
||||
import { AvisoTvTextSettingsDto } from './aviso-tv-settings.dto';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
// Definiere die Response Interfaces
|
||||
@@ -36,7 +36,7 @@ export class AvisoService {
|
||||
.set('seiten', seiten.toString())
|
||||
.set('onlyOK', onlyOK.toString());
|
||||
|
||||
return this.http.get<AvisoArrivalsResponse>(`${this.baseUrl}/arrivals`, { params })
|
||||
return this.http.get<AvisoArrivalsResponse>(`${this.baseUrl}/Aviso/arrivals`, { params })
|
||||
.pipe(
|
||||
tap(data => console.log('AvisoService received arrivals data:', data)), // Logge die empfangenen Daten
|
||||
catchError(this.handleError)
|
||||
@@ -49,9 +49,9 @@ export class AvisoService {
|
||||
* @returns Ein Observable von AvisoTvTextSettingsDto[].
|
||||
*/
|
||||
getAvisoTvTextSettings(standort: string): Observable<AvisoTvTextSettingsDto[]> {
|
||||
return this.http.get<AvisoTvTextSettingsDto[]>(`${this.baseUrl}/${standort}`)
|
||||
return this.http.get<AvisoTvTextSettingsDto[]>(`${this.baseUrl}/AvisoTv/${standort}`)
|
||||
.pipe(
|
||||
tap(data => console.log('AvisoService received TV Text settings data:', data)), // Logge die empfangenen Daten
|
||||
tap(data => console.log('AvisoService received TV Text settings data:', data)),
|
||||
catchError(this.handleError)
|
||||
);
|
||||
}
|
||||
@@ -94,4 +94,12 @@ export class AvisoService {
|
||||
}
|
||||
return throwError(errorMessage);
|
||||
}
|
||||
|
||||
getStandortID(standort: string): Observable<{ standortID: number }> {
|
||||
return this.http.get<{ standortID: number }>(`${this.baseUrl}/AvisoTv/StandortID/${standort}`)
|
||||
.pipe(
|
||||
tap(data => console.log('AvisoService received StandortID:', data)),
|
||||
catchError(this.handleError)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user