fix: use correct endpoint for city rooms on server-side
This commit is contained in:
@@ -138,7 +138,9 @@ class ApiClient {
|
|||||||
|
|
||||||
// City Rooms
|
// City Rooms
|
||||||
async getCityRooms(): Promise<CityRoom[]> {
|
async getCityRooms(): Promise<CityRoom[]> {
|
||||||
return this.fetch<CityRoom[]>('/api/city/rooms')
|
// Server-side: call backend directly, client-side: use proxy
|
||||||
|
const endpoint = typeof window === 'undefined' ? '/city/rooms' : '/api/city/rooms'
|
||||||
|
return this.fetch<CityRoom[]>(endpoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
async getCityRoom(slug: string): Promise<CityRoom | null> {
|
async getCityRoom(slug: string): Promise<CityRoom | null> {
|
||||||
|
|||||||
Reference in New Issue
Block a user