join field - hasamany false does not change the ts type definition #13489
Replies: 3 comments
-
Please add a reproduction in order for us to be able to investigate. Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided. Why was this issue marked with the
|
Beta Was this translation helpful? Give feedback.
-
When I initially worked on adding the |
Beta Was this translation helpful? Give feedback.
-
I agree, it feels strange to get a In the end, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Bug
When I add a join field to my collection it is automatically an HasMany field.
However, If I set it to hasmany:false then it does not update the type accordingly.
{ name: 'order', label: { en: 'Order', }, type: 'join', collection: 'orders', hasMany: false, on: 'bookedResources', },
order?: { docs?: (string | Order)[]; hasNextPage?: boolean; totalDocs?: number; };
There should not be an array type here imo.
Link to the code that reproduces this issue
https://payloadcms.com/docs/fields/join
Reproduction Steps
Create a field "join" and set has many to false - it does no update the ts type
Which area(s) are affected? (Select all that apply)
area: core, Not sure
Environment Info
Beta Was this translation helpful? Give feedback.
All reactions