Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -558,8 +558,8 @@ async def upload_document(
|
|
558 |
cnx.close()
|
559 |
|
560 |
logging.info(f"Document {documentName} uploaded successfully")
|
561 |
-
|
562 |
-
return RedirectResponse(url="/knowledgebase", status_code=302)
|
563 |
except mysql.connector.Error as err:
|
564 |
logging.error(f"Database error: {err}")
|
565 |
raise HTTPException(status_code=500, detail="Internal Server Error")
|
@@ -990,7 +990,8 @@ async def API_saveconnectors(request: Request,
|
|
990 |
cursor.close()
|
991 |
cnx.close()
|
992 |
logging.info(f"Data_connectors for {APIName} inserted successfully")
|
993 |
-
return
|
|
|
994 |
except mysql.connector.Error as err:
|
995 |
logging.error(f"Database error: {err}")
|
996 |
raise HTTPException(status_code=500, detail="Internal Server Error")
|
|
|
558 |
cnx.close()
|
559 |
|
560 |
logging.info(f"Document {documentName} uploaded successfully")
|
561 |
+
return JSONResponse(status_code=200, content={"message": "Data saved successfully", "row_id": row_id})
|
562 |
+
#return RedirectResponse(url="/knowledgebase", status_code=302)
|
563 |
except mysql.connector.Error as err:
|
564 |
logging.error(f"Database error: {err}")
|
565 |
raise HTTPException(status_code=500, detail="Internal Server Error")
|
|
|
990 |
cursor.close()
|
991 |
cnx.close()
|
992 |
logging.info(f"Data_connectors for {APIName} inserted successfully")
|
993 |
+
return JSONResponse(status_code=200, content={"message": "Data saved successfully", "row_id": row_id})
|
994 |
+
#return RedirectResponse(url="/data_connectors", status_code=302)
|
995 |
except mysql.connector.Error as err:
|
996 |
logging.error(f"Database error: {err}")
|
997 |
raise HTTPException(status_code=500, detail="Internal Server Error")
|