Skip to content

fix duplicates when sorting by publication date#84

Merged
davehorsfall merged 3 commits intomainfrom
dev
Jan 22, 2026
Merged

fix duplicates when sorting by publication date#84
davehorsfall merged 3 commits intomainfrom
dev

Conversation

@dannda
Copy link
Contributor

@dannda dannda commented Jan 21, 2026

Description

fix sorting studies by publication date to avoid duplicates

Type of change

  • 🐛 Bug fix (non-breaking change that resolves an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • ⚡ Optimisation (non-breaking improvement to performance or efficiency)
  • 🧩 Documentation (adds or improves documentation)
  • 🧱 Maintenance (refactor, dependency update, CI/CD, etc.)
  • 🔥 Breaking change (fix or feature that causes existing functionality to change)

Checklist

  • All tests pass (eg. npm test)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)
  • Documentation updated (if required)

Copilot AI review requested due to automatic review settings January 21, 2026 14:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where sorting studies by publication date resulted in duplicate entries. The fix prevents Strapi's nested sorting behavior (which causes duplicates per Strapi issue #11892) by explicitly setting sort: null when fetching studies, then applying manual sorting logic.

Changes:

  • Modified the find method in the study controller to set sort: null when fetching studies that need to be sorted by publication date

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dannda dannda requested a review from davehorsfall January 21, 2026 16:16
@davehorsfall davehorsfall merged commit de25112 into main Jan 22, 2026
1 check passed
@davehorsfall
Copy link
Member

🎉 This PR is included in version 1.5.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants