DS.BuildURLMixin#urlForQueryRecord()

urlForQueryRecord (query, modelName) String

Defined in addon/-private/adapters/build-url-mixin.js:191

Builds a URL for a store.queryRecord(type, query) call.

Example:

app/adapters/application.js
1
2
3
4
5
6
7
8
import DS from 'ember-data';
 
export default DS.RESTAdapter.extend({
  urlForQueryRecord({ slug }, modelName) {
    let baseUrl = this.buildURL();
    return `${baseUrl}/${encodeURIComponent(slug)}`;
  }
});

Parameters:

query Object
modelName String

Returns:

String
url
doc_EmberJs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.