Why do FilterOptionsProps pass in a Partial user?

default discord avatar
thgh
7 months ago
1

Is it because the JWT does not contain all fields?


FilterOptionsProps<T = any> = {
    id: string | number;
    user: Partial<User>;
  • discord user avatar
    jesschow
    Payload Team
    6 months 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
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.