Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Custom sort on collection?

default discord avatar
ssyberg2 years ago
1

What is best practice for applying a custom sort function to a collection (something that goes beyond

defaultSort

)? I thought I'd be able to use a collection hook here but looks like there are no hooks that have access to the entire

docs

array. Our immediate goal is to set a specific order for a related field drop down options.



Also tried a custom endpoint, but doesn't seem like that affects the local API

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.