mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
fix(documents): use ORM objects in bulk_move so session hooks fire
This commit is contained in:
parent
75a1fee4e3
commit
d2c4b046bf
1 changed files with 2 additions and 5 deletions
|
|
@ -525,11 +525,8 @@ async def bulk_move_documents(
|
|||
detail="Cannot move documents to a folder in a different search space",
|
||||
)
|
||||
|
||||
await session.execute(
|
||||
Document.__table__.update()
|
||||
.where(Document.id.in_(request.document_ids))
|
||||
.values(folder_id=request.folder_id)
|
||||
)
|
||||
for doc in documents:
|
||||
doc.folder_id = request.folder_id
|
||||
await session.commit()
|
||||
return {"message": f"{len(request.document_ids)} documents moved successfully"}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue