xdevplatform / Twitter-API-v2-sample-code

Sample code for the Twitter API v2 endpoints
https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api
Apache License 2.0
2.61k stars 967 forks source link

Incorrect usage of template literal in JavaScript code #124

Open maski07 opened 1 year ago

maski07 commented 1 year ago

Describe the bug There is an error in the usage of template literal in the following code:

const endpointURL = `https://api.twitter.com/2/users/me?{params}`;

It should be corrected to:

const endpointURL = `https://api.twitter.com/2/users/me?${params}`;

This bug is causing unexpected behavior in the program.

To Reproduce Steps to reproduce the behavior:

  1. Go to the section where the code is used
  2. Execute the code

Expected behavior The code should execute without any error or unexpected behavior.

Additional context Nothing

maski07 commented 1 year ago

I have addressed the issue in the following pull request: https://github.com/twitterdev/Twitter-API-v2-sample-code/pull/123

Would you please review the changes and consider merging them if they meet the requirements? Thank you for your attention.