From 5933d7a216e8e3b8e58cd634ec26d2f134dd2b85 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 1 Oct 2024 21:35:18 -0700 Subject: [PATCH] enh: sort by descending order --- backend/open_webui/apps/webui/models/projects.py | 4 +++- src/lib/components/workspace/Projects.svelte | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/webui/models/projects.py b/backend/open_webui/apps/webui/models/projects.py index 4debbbe28..07535c958 100644 --- a/backend/open_webui/apps/webui/models/projects.py +++ b/backend/open_webui/apps/webui/models/projects.py @@ -102,7 +102,9 @@ class ProjectTable: with get_db() as db: return [ ProjectModel.model_validate(project) - for project in db.query(Project).all() + for project in db.query(Project) + .order_by(Project.updated_at.desc()) + .all() ] def get_project_by_id(self, id: str) -> Optional[ProjectModel]: diff --git a/src/lib/components/workspace/Projects.svelte b/src/lib/components/workspace/Projects.svelte index 0eda768f4..01f0c3400 100644 --- a/src/lib/components/workspace/Projects.svelte +++ b/src/lib/components/workspace/Projects.svelte @@ -115,7 +115,6 @@
{#each filteredProjects as project} - {JSON.stringify(project)}