Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -300,7 +300,11 @@ async def mobile_process_receipts(background_tasks: BackgroundTasks, sheeturl: s
|
|
| 300 |
async with httpx.AsyncClient(follow_redirects=True, timeout=timeout) as client:
|
| 301 |
response = await client.post(appsScriptsURL, json=body)
|
| 302 |
print(response)
|
| 303 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 304 |
if response.status_code != 200:
|
| 305 |
logging.error(f"Unexpected response from Google Apps Script API: {response.status_code} - {response.text}")
|
| 306 |
raise HTTPException(status_code=500, detail="Error in trying to connect to your sheet. Please try again.")
|
|
|
|
| 300 |
async with httpx.AsyncClient(follow_redirects=True, timeout=timeout) as client:
|
| 301 |
response = await client.post(appsScriptsURL, json=body)
|
| 302 |
print(response)
|
| 303 |
+
if response.content:
|
| 304 |
+
print(response.json())
|
| 305 |
+
else:
|
| 306 |
+
print("Empty response")
|
| 307 |
+
return {"message": "No documents were found."}
|
| 308 |
if response.status_code != 200:
|
| 309 |
logging.error(f"Unexpected response from Google Apps Script API: {response.status_code} - {response.text}")
|
| 310 |
raise HTTPException(status_code=500, detail="Error in trying to connect to your sheet. Please try again.")
|