How to define TS for access and others thing?

default discord avatar
IRediTOTO
9 months ago
1 1

Hi, I am trying define typescript for access in CollectionConfig

const User = CollectionConfig={
...
access: {
    read: ({ req: { user } }) => {  // How to define ts for user var here ?
      return true;
    },
  },
  ...

}
  • discord user avatar
    JessChowdhury
    Payload Team
    8 months ago

    Hi @IRediTOTO - this blog post should get you on track!

    After running payload generate:types you should be able to import user from your generated types file and use this in your code above.

Open the post
Continue the discussion in GitHub
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.