mirror of
https://github.com/open-webui/open-webui.git
synced 2026-01-02 14:45:18 +00:00
refac
This commit is contained in:
parent
c79fb7db74
commit
eb4b085b86
1 changed files with 7 additions and 2 deletions
|
|
@ -244,9 +244,14 @@ class NoteTable:
|
||||||
return [NoteModel.model_validate(note) for note in notes]
|
return [NoteModel.model_validate(note) for note in notes]
|
||||||
|
|
||||||
def search_notes(
|
def search_notes(
|
||||||
self, user_id: str, filter: dict = {}, skip: int = 0, limit: int = 30
|
self,
|
||||||
|
user_id: str,
|
||||||
|
filter: dict = {},
|
||||||
|
skip: int = 0,
|
||||||
|
limit: int = 30,
|
||||||
|
db: Optional[Session] = None,
|
||||||
) -> NoteListResponse:
|
) -> NoteListResponse:
|
||||||
with get_db() as db:
|
with get_db_context(db) as db:
|
||||||
query = db.query(Note, User).outerjoin(User, User.id == Note.user_id)
|
query = db.query(Note, User).outerjoin(User, User.id == Note.user_id)
|
||||||
if filter:
|
if filter:
|
||||||
query_key = filter.get("query")
|
query_key = filter.get("query")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue