How to get current selected locale inside Collection Hooks?

default discord avatar
angelok2741
9 months ago
1

Title says it all.



I am using the beforeChange Collection hook to save a field with data coming from the parent through payload.findByID but this always returns the parent data from the default locale. Is there a way to get the current selected locale so I can use this in the findById query?



Thanks!



Ok, I can just get it from the express request!

    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.