fix(rooms): Use rewrite for /api/city/rooms instead of API route

- Removed API route that was conflicting with rewrite
- Added explicit rewrite for /api/city/rooms -> /api/v1/city/rooms
- Rewrite order matters: specific routes before wildcard
This commit is contained in:
Apple
2025-12-01 08:52:59 -08:00
parent 0039be5dc0
commit a563ec86a0
2 changed files with 7 additions and 31 deletions

View File

@@ -41,12 +41,18 @@ const nextConfig: NextConfig = {
source: '/api/public/:path*',
destination: `${internalApiUrl}/public/:path*`,
},
// City Rooms API (list) -> /api/v1/city/rooms
// Note: This must be before /api/city/:path* to take precedence
{
source: '/api/city/rooms',
destination: `${internalApiUrl}/api/v1/city/rooms`,
},
// City Rooms API (specific slug endpoint) -> /api/v1/city/rooms
{
source: '/api/city/rooms/:slug',
destination: `${internalApiUrl}/api/v1/city/rooms/:slug`,
},
// City API -> /city
// City API -> /city (excludes /api/city/rooms which is handled above)
{
source: '/api/city/:path*',
destination: `${internalApiUrl}/city/:path*`,