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

change methods arguments to be nullable #118

Merged
merged 7 commits into from
Aug 22, 2020

Conversation

windmemory
Copy link
Member

Align definition with wechaty/grpc#81

Also use null value to clear the corporation remark or description.

@windmemory windmemory requested a review from huan August 21, 2020 13:08
@windmemory windmemory requested a review from a team as a code owner August 21, 2020 13:08
Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

Could you please explain why do we have a contactPhone set method but have no contactcorporationRemark set method?

@windmemory
Copy link
Member Author

We do have set method for phone, corporationRemark and description, but we don't have get method for corporationRemark and description since we put it into the payload. Do you think we need a method to get it?

@huan
Copy link
Member

huan commented Aug 21, 2020

We have three new payloads: phone, description, and corporationRemark.

You mean 2 of them are in the payload but the other is not?

Should we put them all into the payload, or remove them all out of the payload, I mean, treat them all the same class citizen?

@windmemory
Copy link
Member Author

Yes, the phone is not in the payload now, maybe we should put it also in the payload?

@huan
Copy link
Member

huan commented Aug 21, 2020

I'd like to keep them the same class because they are very similar payload properties, aren't they?

So let's put the phone to the payload, then all those methods will only need to implement the set method.

@windmemory
Copy link
Member Author

Yep, I think you are right, modified the code according to the comment.

Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

Please fix the array optionally property then we will be able to merge it.

src/schemas/contact.ts Outdated Show resolved Hide resolved
Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

LGTM

@huan huan merged commit b4ad55c into master Aug 22, 2020
@huan huan deleted the null-parameters-for-new-contact-methods branch August 22, 2020 06:26
@huan
Copy link
Member

huan commented Aug 22, 2020

Thank you very much for the improvement!

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