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

Incorrect url building for GET_MANY request type #2

Open
eksd opened this issue Nov 27, 2019 · 0 comments
Open

Incorrect url building for GET_MANY request type #2

eksd opened this issue Nov 27, 2019 · 0 comments

Comments

@eksd
Copy link

eksd commented Nov 27, 2019

The source code for GET_MANY url building is the following:

      case GET_MANY: {
        const query = {
          filter: JSON.stringify({ id: params.ids })
        };
        let idStr = "";
        const queryString = params.ids.map(id => idStr + `id=${id}`);
        url = `${apiUrl}/${resource}?${idStr}}`;
        break;
      }

Here we have 3 different mistakes:

  1. variable 'query' is created but never used after.
  2. variable 'queryString' is created but instead of it an empty 'idStr' is used.
  3. redundant bracket ${idStr}};

As a result, GET_MANY url is completely unusable.

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

No branches or pull requests

1 participant