Skip to content

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

@rakesh5208

Description

@rakesh5208

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions