Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing sort parameter options for GET /dois #1098

Merged
merged 2 commits into from
May 10, 2024

Conversation

KellyStathis
Copy link
Collaborator

Purpose

Add missing "sort" parameter options for a GET request to /dois.

Approach

Add parameters listed here:

sort =
case params[:sort]
when "name"
{ "doi" => { order: "asc" } }
when "-name"
{ "doi" => { order: "desc" } }
when "created"
{ created: { order: "asc" } }
when "-created"
{ created: { order: "desc" } }
when "updated"
{ updated: { order: "asc" } }
when "-updated"
{ updated: { order: "desc" } }
when "published"
{ published: { order: "asc" } }
when "-published"
{ published: { order: "desc" } }
when "view-count"
{ view_count: { order: "asc" } }
when "-view-count"
{ view_count: { order: "desc" } }
when "download-count"
{ download_count: { order: "asc" } }
when "-download-count"
{ download_count: { order: "desc" } }
when "citation-count"
{ citation_count: { order: "asc" } }
when "-citation-count"
{ citation_count: { order: "desc" } }
when "title"
{ "primary_title.title.raw": { order: "asc" } }
when "-title"
{ "primary_title.title.raw": { order: "desc" } }
when "relevance"
{ "_score": { "order": "desc" } }
else
{ updated: { order: "desc" } }
end

Open Questions and Pre-Merge TODOs

Learning

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@codycooperross codycooperross merged commit 2d94b20 into master May 10, 2024
13 checks passed
@codycooperross codycooperross deleted the openapi_dois-sort branch May 10, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants