-
Notifications
You must be signed in to change notification settings - Fork 7
fix: nested relation create #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: nested relation create #157
Conversation
🦋 Changeset detectedLatest commit: 86e4db5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| allowConnect={true} | ||
| allowCreate={true} | ||
| allowConnect={false} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 options (connect, create, connectOrCreate) does not give the same result of AutoRelationshipField
It should be
allowConnect={field.type === "connect" || field.type === "connectOrCreate"}
allowCreate={field.type === "create" || field.type === "connectOrCreate"}| interface AutoRelationshipFieldProps { | ||
| name: string | ||
| fieldShape: FieldRelationShapeClient | ||
| prefix: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be responsibility of name. Try to utilize it.
|
About default value of update form. It should be from export type CollectionUpdateConfig<
TContext extends AnyContextable = AnyContextable,
TFields extends Fields = Fields,
> = {
fields: TFields
updateApi?: ApiConfigHandlerFn<TContext, TFields, typeof ApiDefaultMethod.UPDATE>
// TODO: This is not correct, it should return default value of form instead of just simple findOne response
updateDefaultApi?: ApiConfigHandlerFn<TContext, TFields, typeof ApiDefaultMethod.FIND_ONE>
} & CollectionFieldsOptions<TContext, TFields>Currently, it just a clone of |
|
You can find the similar function in |
|
Please also add changeset file and describe what you did in this PR into it. |
I think update logic is much more complicated and required more coordination than this PR. For example, if a post has 3 post tags |
092204c to
8945254
Compare
8945254 to
86e4db5
Compare
Why did you create this PR
Nested create flow is not working
What did you do
For update flow, I can't find function which map prisma values into form. Even though it exists, I can't decide by myself what is it behavior.
Screenshots / Recordings
2025-08-18.19-51-02.mov
Checklist