Skip to content
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

Suggestion about Field.get Method #45

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

brasiqui
Copy link

@brasiqui brasiqui commented May 7, 2023

Hi,
Another suggestion.
Would it be possible to enable insertion of a string pointing to a method for field.get as it exists in field.set?
Sometimes the logic for transforming the value can be extensive and using a method would be more organized.

Thanks,
Roni Cruz

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, could you plz add a test to it?

@brasiqui
Copy link
Author

Now, I wrote a test. But I couldn't run it locally.
NPM Install fails.

@icebob
Copy link
Member

icebob commented May 22, 2023

Could you show the error message?

@brasiqui
Copy link
Author

image

@brasiqui
Copy link
Author

Tests updated.

@@ -76,6 +95,8 @@ module.exports = (getAdapter, adapterType) => {
const res = await svc.createEntity(ctx, {
name: "John Doe",
upperName: "Nothing",
lowerName: "Nothing",
lengthName: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are readonly fields, why do you send them in create?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants