Skip to content

Commit

Permalink
Refactor deep find strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
vjoao committed Jul 26, 2018
1 parent de8aa21 commit 5af1baf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,8 @@ export default class Model extends StaticModel {
if (identifier === undefined) {
throw new Error('You must specify the param on find() method.')
}

let url = `${this.baseURL()}/${this.resource()}/${identifier}${this._builder.query()}`

if ('_fromResource' in this) {
url = `${this._fromResource}/${identifier}${this._builder.query()}`
}
let base = this._fromResource || `${this.baseURL()}/${this.resource()}`
let url = `${base}/${identifier}${this._builder.query()}`

return this.request({
url,
Expand Down

0 comments on commit 5af1baf

Please sign in to comment.