DS.BuildURLMixin#urlForFindRecord()

urlForFindRecord (id, modelName, snapshot) String

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

Builds a URL for a store.findRecord(type, id) call.

Example:

app/adapters/user.js
import DS from 'ember-data';

export default DS.JSONAPIAdapter.extend({
  urlForFindRecord(id, modelName, snapshot) {
    let baseUrl = this.buildURL();
    return `${baseUrl}/users/${snapshot.adapterOptions.user_id}/playlists/${id}`;
  }
});

Parameters:

id String
modelName String
snapshot DS.Snapshot

Returns:

String
url
doc_EmberJs
2016-11-30 16:49:31
Comments
Leave a Comment

Please login to continue.