Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -227,11 +227,11 @@ async def list_similar_files():
|
|
227 |
except FileNotFoundError:
|
228 |
raise HTTPException(status_code=404, detail="Diret贸rio de dados n茫o encontrado")
|
229 |
|
230 |
-
@app.get("/files/find/{
|
231 |
-
async def
|
232 |
try:
|
233 |
for filename in os.listdir(BASE_DIR):
|
234 |
-
if
|
235 |
filepath = os.path.join(BASE_DIR, filename)
|
236 |
if os.path.isfile(filepath):
|
237 |
try:
|
|
|
227 |
except FileNotFoundError:
|
228 |
raise HTTPException(status_code=404, detail="Diret贸rio de dados n茫o encontrado")
|
229 |
|
230 |
+
@app.get("/files/find/{search}")
|
231 |
+
async def search_file(search: str):
|
232 |
try:
|
233 |
for filename in os.listdir(BASE_DIR):
|
234 |
+
if f"{search}" in filename and filename.endswith(".json"):
|
235 |
filepath = os.path.join(BASE_DIR, filename)
|
236 |
if os.path.isfile(filepath):
|
237 |
try:
|