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 custom pair fields examples (#8663) #8664
Conversation
gathanase
commented
Jul 3, 2023
•
edited by dcousens
edited by dcousens
- Fixes Example pair custom fields are reset if not changed during update #8663
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f42430b:
|
718c455
to
050f927
Compare
@@ -44,6 +44,7 @@ export function pair<ListTypeInfo extends BaseListTypeInfo>( | |||
config: PairFieldConfig<ListTypeInfo> = {} | |||
): FieldTypeFunc<ListTypeInfo> { | |||
function resolveInput(value: PairInput | null | undefined) { | |||
if (!value) return undefined; |
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.
@gathanase thanks for making the changes, but I think this might want to be specifically
if (value === undefined) return undefined
null
is a value users might want to use and put in the database, whereas undefined
means "unchanged".
I might be wrong, but that's my understanding.
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.
If the user want to put null in database then we should return null if value is null. In any case, I think you are right that we should only consider undefined.
050f927
to
f42430b
Compare
Thanks @gathanase! 💛 |