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

Update api.js for fix #64 #96

Closed

Conversation

roberto-butti
Copy link

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe):

How to test this PR

THe issue fixed by this PR is well documented here #64

it closes #64

src/utils/api.js Outdated
@@ -13,19 +13,26 @@ export default {
oauthToken: '',
spaceId: null,
region: '',
client: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @roberto-butti I would not set it to false since the property is meant to be an object. It's better to set it to null initially.

Copy link
Author

Choose a reason for hiding this comment

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

Hola @alvarosabu , thank you for your feedback. I adapted the code according to your feedback

src/utils/api.js Outdated
...DEFAULT_AGENT
}
}, this.apiSwitcher(region))
if (this.client === false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (this.client === false) {
if (!this.client) {

Copy link
Author

Choose a reason for hiding this comment

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

Hola @alvarosabu , thank you for your feedback. I adapted the code according to your feedback

@roberto-butti
Copy link
Author

Walking through previous issues and PRs i see that there are some related contributions and feedback from other developers.
Similar PRs:

I tested it with pull-components, push-components, sync , import

At the moment, the check is made on the instance of the client. Probably in the future, if we need more client instances we should evaluate to check tokens etc. (when we check the existence of the client instance)

@alvarosabu alvarosabu closed this May 24, 2024
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.

storyblok push-components aborts with "Error: Too Many Requests"
2 participants