Skip to content

Commit

Permalink
74: make the handler for GET /api/examples return the (matching) `E…
Browse files Browse the repository at this point in the history
…xample` resources in order of decreasing IDs
  • Loading branch information
Kaloyan Marinov committed Aug 18, 2024
1 parent 8abbeda commit 1fa3753
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/api/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ def get_examples():
)
query_param_kwargs["content_translation"] = content_translation

examples_query = examples_query.order_by(Example.id.desc())

per_page = min(
100,
request.args.get("per_page", default=10, type=int),
)
page = request.args.get("page", default=1, type=int)

examples_collection = Example.to_collection_dict(
examples_query,
per_page,
Expand Down

1 comment on commit 1fa3753

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

badge-test-coverage

Please sign in to comment.