Update routes/hello.py
Browse files- routes/hello.py +6 -2
routes/hello.py
CHANGED
@@ -238,7 +238,7 @@ def get_terms(type: str = Query(..., regex="^(use|privacy)$")):
|
|
238 |
try:
|
239 |
term_type = "Terms of Use" if type == "use" else "Privacy Policy"
|
240 |
|
241 |
-
url = f"{SUPABASE_URL}/rest/v1/Configuration?type=eq.{term_type}&select=text"
|
242 |
response = requests.get(url, headers=SUPABASE_HEADERS)
|
243 |
|
244 |
if response.status_code != 200:
|
@@ -248,7 +248,11 @@ def get_terms(type: str = Query(..., regex="^(use|privacy)$")):
|
|
248 |
if not data:
|
249 |
raise HTTPException(status_code=404, detail="Termo não encontrado")
|
250 |
|
251 |
-
return {
|
|
|
|
|
|
|
|
|
252 |
|
253 |
except Exception as e:
|
254 |
raise HTTPException(status_code=500, detail=str(e))
|
|
|
238 |
try:
|
239 |
term_type = "Terms of Use" if type == "use" else "Privacy Policy"
|
240 |
|
241 |
+
url = f"{SUPABASE_URL}/rest/v1/Configuration?type=eq.{term_type}&select=text,date"
|
242 |
response = requests.get(url, headers=SUPABASE_HEADERS)
|
243 |
|
244 |
if response.status_code != 200:
|
|
|
248 |
if not data:
|
249 |
raise HTTPException(status_code=404, detail="Termo não encontrado")
|
250 |
|
251 |
+
return {
|
252 |
+
"type": term_type,
|
253 |
+
"text": data[0]["text"],
|
254 |
+
"last_updated": data[0]["date"]
|
255 |
+
}
|
256 |
|
257 |
except Exception as e:
|
258 |
raise HTTPException(status_code=500, detail=str(e))
|