habulaj commited on
Commit
d97c844
·
verified ·
1 Parent(s): e9983ad

Update routes/subscription.py

Browse files
Files changed (1) hide show
  1. routes/subscription.py +9 -1
routes/subscription.py CHANGED
@@ -178,7 +178,15 @@ async def create_price(
178
  "emergency_price": emergency_price, # Atualizando o valor de 'emergency_price'
179
  "consultations": consultations # Atualizando o valor de 'consultations'
180
  }
181
- update_response = requests.patch(supabase_url, headers=headers, json=update_data)
 
 
 
 
 
 
 
 
182
 
183
  # Log detalhado para verificar a resposta
184
  logger.info(f"🔹 Supabase PATCH response: {update_response.status_code} - {update_response.text}")
 
178
  "emergency_price": emergency_price, # Atualizando o valor de 'emergency_price'
179
  "consultations": consultations # Atualizando o valor de 'consultations'
180
  }
181
+
182
+ # Aqui estamos incluindo o cabeçalho de autenticação com o token JWT correto
183
+ update_headers = {
184
+ "Authorization": f"Bearer {user_token}", # Incluindo token correto no header
185
+ "apikey": SUPABASE_KEY,
186
+ "Content-Type": "application/json"
187
+ }
188
+
189
+ update_response = requests.patch(supabase_url, headers=update_headers, json=update_data)
190
 
191
  # Log detalhado para verificar a resposta
192
  logger.info(f"🔹 Supabase PATCH response: {update_response.status_code} - {update_response.text}")