Custom sort on collection?

default discord avatar
seth
7 months ago
2

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

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.