Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Sort entries alphabetically (#72)
Browse files Browse the repository at this point in the history
* Sort entries alphabetically

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ml-evs and pre-commit-ci[bot] authored Jan 23, 2024
1 parent 2165323 commit 7f6a88e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion marda_registry/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def get_filetypes():
},
# Remove the temporary `extractors` field
{"$project": {"_id": 0, "extractors": 0}},
{"$sort": {"id": 1}},
]
)
),
Expand Down Expand Up @@ -129,7 +130,15 @@ def search_file_types(query: str):
@api.get("/extractors", response_model=ExtractorEntryResponse)
def get_extractors():
return {
"data": list(db.extractors.find({}, projection={"_id": 0})),
"data": list(
db.extractors.find(
{},
projection={"_id": 0},
sort=[
("id", 1),
],
)
),
"meta": _get_info(),
}

Expand Down

0 comments on commit 7f6a88e

Please sign in to comment.