fix: api url

This commit is contained in:
shahdlala66
2026-06-23 10:16:25 +02:00
parent 00b51b57b4
commit 2229cfd00a
+2 -1
View File
@@ -2,6 +2,7 @@ import { Injectable, inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Tournament, TournamentList, RoundPairings } from '../models/tournament.models';
import { environment } from '../../environments/environment';
export interface CreateTournamentForm {
name: string;
@@ -14,7 +15,7 @@ export interface CreateTournamentForm {
@Injectable({ providedIn: 'root' })
export class TournamentService {
private readonly http = inject(HttpClient);
private readonly base = '/api/tournament';
private readonly base = `${(environment.tournamentServerUrl ?? '').replace(/\/+$/, '')}/api/tournament`;
list(): Observable<TournamentList> {
return this.http.get<TournamentList>(this.base);