diff --git a/scoap3/articles/api/views.py b/scoap3/articles/api/views.py index d41819ae2..96365bfbe 100644 --- a/scoap3/articles/api/views.py +++ b/scoap3/articles/api/views.py @@ -108,8 +108,8 @@ def __init__(self, *args, **kwargs): "article_identifiers.identifier_value", ) - ordering_fields = {"_updated_at": "_updated_at"} - ordering = ["-_updated_at"] + ordering_fields = {"publication_date": "publication_date"} + ordering = ["publication_date"] filter_fields = { "publication_year": { diff --git a/scoap3/articles/tests/test_article_views.py b/scoap3/articles/tests/test_article_views.py index c86b2d2ca..8b8eef3c7 100644 --- a/scoap3/articles/tests/test_article_views.py +++ b/scoap3/articles/tests/test_article_views.py @@ -36,7 +36,9 @@ def test_create_article_from_workflow(self, client, user, shared_datadir): == "The Effective QCD Running Coupling Constant and a Dirac Model for the Charmonium Spectrum" ) - def test_create_article_from_workflow_with_large_text(self, client, user, shared_datadir): + def test_create_article_from_workflow_with_large_text( + self, client, user, shared_datadir + ): client.force_login(user) contents = (shared_datadir / "workflow_record_with_large_text.json").read_text() data = json.loads(contents) diff --git a/ui/src/components/search/SearchResults.tsx b/ui/src/components/search/SearchResults.tsx index 90a745a98..870fc38a9 100644 --- a/ui/src/components/search/SearchResults.tsx +++ b/ui/src/components/search/SearchResults.tsx @@ -24,11 +24,11 @@ const SearchResults: React.FC = ({ const sortOptions = [ { label: "Most recent", - value: "_updated_at", + value: "-publication_date", }, { label: "Least recent", - value: "-_updated_at", + value: "publication_date", }, ]; @@ -55,7 +55,7 @@ const SearchResults: React.FC = ({ options={sortOptions} className="sort-dropdown ml-3" onChange={sortResults} - defaultValue="_updated_at" + defaultValue="-publication_date" >