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

Url is not build properly when there is a query params in the adapter buildUrl method. #414

Open
rakesh5208 opened this issue Nov 20, 2019 · 0 comments · May be fixed by #506 or qonto/ember-api-actions#8
Labels

Comments

@rakesh5208
Copy link

rakesh5208 commented Nov 20, 2019

Let say i have the Todo adapter and override the buildURL and added the query params for the this model.
Eg:

/adapters/todo.js

buildURL(modelName, id, snapshot, requestType, query) {
   let scope = 'active';
   switch (requestType) {
      case 'query':
      case 'queryRecord':
        url = this._super(modelName, id, snapshot, requestType, query);
        break;
      default:
        url = this._super(...arguments);
        url = key ? `${url}?scope=${key}` : url;
    }
    return url;
} 

Now in the todo model, i have a member action which is like:

removeTag: memberAction({
    path: 'tags',
    type: 'delete'
  })

so once calling the removeTag method, the url is created like:
http://localhost:3000/todos?scope='active'/tags

@Turbo87 Turbo87 added the bug label Apr 3, 2020
mrloop added a commit to mrloop/mike-north-ember-api-actions that referenced this issue Mar 12, 2021
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
@mrloop mrloop linked a pull request Mar 12, 2021 that will close this issue
mrloop added a commit to mrloop/mike-north-ember-api-actions that referenced this issue Mar 22, 2021
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
mrloop added a commit to mrloop/mike-north-ember-api-actions that referenced this issue Mar 22, 2021
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
mrloop added a commit to mrloop/mike-north-ember-api-actions that referenced this issue Jul 7, 2021
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
mrloop added a commit to qonto/ember-api-actions that referenced this issue Aug 25, 2022
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
@mrloop mrloop linked a pull request Aug 25, 2022 that will close this issue
mrloop added a commit to qonto/ember-api-actions that referenced this issue Aug 25, 2022
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
mrloop added a commit to qonto/ember-api-actions that referenced this issue Aug 25, 2022
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
mrloop added a commit to qonto/ember-api-actions that referenced this issue Aug 25, 2022
This PR will correctly construct a URL where the ember-api-action path
contains query params and/or where the ember data adapter buildURL
returns a url containing query params.

Fixes mike-north#414
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment