-
Notifications
You must be signed in to change notification settings - Fork 49
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: undefined check for guestSpaceId of rest-api-client #622
Conversation
In our team, we often write code that looks like this ```js const Apps = { isGuestSpace: false, spaceId: 32, user: 126, order: 127, billing: 128, }; const client = new KintoneRestAPIClient({ guestSpaceId: Apps.isGuestSpace ? Apps.spaceId : undefined }) ``` We want you to treat not only `undefined`, but also `null` and `''` in the same way. ```js const client = new KintoneRestAPIClient({ guestSpaceId: Apps.isGuestSpace ? Apps.spaceId : null }) const client = new KintoneRestAPIClient({ guestSpaceId: Apps.isGuestSpace ? Apps.spaceId : '' }) ```
@the-red I didn't catch why this change is required. Why do you want to write as The current implementation is intended to be able to omit |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@the-red I understand the behavior what you are reporting; the rest-api-client generates broken request url and causes a runtime error when invalid We plan to make a fix for this behavior with adding a validation. However, we want to consider the appropriate place for validation. (I guess it will be above section you changed.) |
@zaki-yama Thank you!!!! 🚀 |
Why
In our team, we often write code that looks like this
We want you to treat not only
undefined
, but alsonull
and''
in the same way.What
How to test
Checklist
yarn lint
andyarn test
on the root directory.