Daniel Marques commited on
Commit
ea4ffd3
1 Parent(s): 9ef164b

feat: add dele folder

Browse files
Files changed (1) hide show
  1. main.py +3 -3
main.py CHANGED
@@ -136,14 +136,14 @@ def run_ingest_route():
136
  except Exception as e:
137
  raise HTTPException(status_code=500, detail=f"Error occurred: {str(e)}")
138
 
139
- @api_app.get("/api/delete")
140
- def delete_source_route():
141
  upload_dir = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
142
  files = glob.glob(os.path.join(upload_dir, '*'))
143
 
144
  return {"directory": upload_dir, "files": files}
145
 
146
- @api_app.delete("/api/delete")
147
  def delete_source_route(data: Delete):
148
  filename = data.filename
149
  path_source_documents = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
 
136
  except Exception as e:
137
  raise HTTPException(status_code=500, detail=f"Error occurred: {str(e)}")
138
 
139
+ @api_app.get("/api/files")
140
+ def get_files():
141
  upload_dir = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)
142
  files = glob.glob(os.path.join(upload_dir, '*'))
143
 
144
  return {"directory": upload_dir, "files": files}
145
 
146
+ @api_app.delete("/api/delete_document")
147
  def delete_source_route(data: Delete):
148
  filename = data.filename
149
  path_source_documents = os.path.join(os.getcwd(), PATH_NAME_SOURCE_DIRECTORY)