Browse Source

fix: change default ShopRenter API endpoint to api2 #57

Claude 5 months ago
parent
commit
8d21790
1 changed files with 4 additions and 4 deletions
  1. 4 4
      supabase/functions/shoprenter-proxy/index.ts

+ 4 - 4
supabase/functions/shoprenter-proxy/index.ts

@@ -18,8 +18,8 @@ const corsHeaders = {
  *    - Use X-ShopRenter-Token instead of Authorization to avoid Supabase JWT validation
  *    - Use X-ShopRenter-Token instead of Authorization to avoid Supabase JWT validation
  * 2. Set X-ShopRenter-Shop header with shop name (e.g., "elektromosroller")
  * 2. Set X-ShopRenter-Shop header with shop name (e.g., "elektromosroller")
  * 3. (Optional) Set X-ShopRenter-API-Version header to specify API endpoint:
  * 3. (Optional) Set X-ShopRenter-API-Version header to specify API endpoint:
- *    - "api" for api.myshoprenter.hu (default)
- *    - "api2" for api2.myshoprenter.hu
+ *    - "api2" for api2.myshoprenter.hu (default)
+ *    - "api" for api.myshoprenter.hu
  * 4. Make requests to: /shoprenter-proxy/api/{endpoint}
  * 4. Make requests to: /shoprenter-proxy/api/{endpoint}
  *
  *
  * All request methods (GET, POST, PUT, PATCH, DELETE) are supported.
  * All request methods (GET, POST, PUT, PATCH, DELETE) are supported.
@@ -277,8 +277,8 @@ serve(async (req) => {
       )
       )
     }
     }
 
 
-    // Get API version from header (default to 'api' for api.myshoprenter.hu)
-    const apiVersion = req.headers.get('X-ShopRenter-API-Version') || 'api'
+    // Get API version from header (default to 'api2' for api2.myshoprenter.hu)
+    const apiVersion = req.headers.get('X-ShopRenter-API-Version') || 'api2'
 
 
     // Validate API version
     // Validate API version
     if (apiVersion !== 'api' && apiVersion !== 'api2') {
     if (apiVersion !== 'api' && apiVersion !== 'api2') {