Skip to content

Commit

Permalink
fix: if search query is empty, the ordering parameter should default …
Browse files Browse the repository at this point in the history
…to -first_publiched_at
  • Loading branch information
asuworks committed Oct 14, 2024
1 parent 901d920 commit 295dd6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/CodebaseListSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ const initializeFilterValues = () => {
values.endDate = urlParams.get("publishedBefore")
? new Date(urlParams.get("publishedBefore")!)
: null;
values.ordering = urlParams.get("ordering") || "relevance";
values.ordering =
urlParams.get("ordering") || (urlParams.get("query") ? "relevance" : "-first_published_at");
initialFilterValues.value = { ...values };
};
Expand Down

0 comments on commit 295dd6d

Please sign in to comment.