Like what we’re doing? Star us on GitHub!

Why do FilterOptionsProps pass in a Partial user?

thgh
last month
1

Is it because the JWT does not contain all fields?


FilterOptionsProps<T = any> = {
    id: string | number;
    user: Partial<User>;
  • jesschow
    Payload Team
    2 weeks ago

    hi @thgh -

    Partial<User>

    is used as there are cases when no user is passed through to

    filterOptions

    . We could also use

    User | null

    which might be clearer.

Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More