mirror of
https://github.com/open-webui/open-webui.git
synced 2025-04-24 07:20:40 +02:00
Add query param to remove content from GET /api/v1/files
This commit is contained in:
parent
be20e6dec0
commit
6d5cb6b04e
@ -162,11 +162,15 @@ def upload_file(
|
||||
|
||||
|
||||
@router.get("/", response_model=list[FileModelResponse])
|
||||
async def list_files(user=Depends(get_verified_user)):
|
||||
async def list_files(user=Depends(get_verified_user), content: bool = Query(True)):
|
||||
if user.role == "admin":
|
||||
files = Files.get_files()
|
||||
else:
|
||||
files = Files.get_files_by_user_id(user.id)
|
||||
|
||||
if not content:
|
||||
for file in files:
|
||||
file.data['content'] = ""
|
||||
return files
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user