fix: api url
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user