How to get current selected locale inside Collection Hooks?

default discord avatar
9 months ago

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?


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!


    Connect with the Payload Community on Discord



    Can't find what you're looking for?

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