#relationship

7 messages · Page 1 of 1 (latest)

fierce smelt
#

I created a collection work_types
I have a block field relationto that collection
I call that block on frontend
its returning the id of the relation...

I noticed that on payload generate:types, created that field where it says it can return a string (id) or the Collection type (work_types)

how could I return the collection instead of just of the id?

fierce smelt
#

i think the answer is maxDepth: 1

karmic starBOT
fierce smelt
#
import { anyone } from '@/access/anyone';

const WorkTypes: CollectionConfig = {
  ...
  access: {
    read: anyone,
  },
  ...
}