enh: sort by descending order

This commit is contained in:
Timothy J. Baek 2024-10-01 21:35:18 -07:00
parent 1b7d363d32
commit 5933d7a216
2 changed files with 3 additions and 2 deletions

View File

@ -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]:

View File

@ -115,7 +115,6 @@
<div class="my-3 mb-5 grid md:grid-cols-2 gap-2">
{#each filteredProjects as project}
{JSON.stringify(project)}
<button
class=" flex space-x-4 cursor-pointer text-left w-full px-4 py-3 border border-gray-50 dark:border-gray-850 hover:bg-gray-50 dark:hover:bg-gray-850 rounded-xl"
>