-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
music route now has detail and listen links for each song
- Loading branch information
1 parent
d8c6b31
commit 3c12ee3
Showing
5 changed files
with
47 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import JSONAPIAdapter from '@ember-data/adapter/json-api'; | ||
import ENV from 'remember-stuff/config/environment'; | ||
|
||
export default class SongAdapter extends JSONAPIAdapter { | ||
host = 'https://music.nebyoolae.com'; | ||
host = ENV.APP.MUSIC_API_ROOT; | ||
namespace = 'jsonapi/views'; | ||
viewType = 'songs'; | ||
viewId = 'songs_neb_5'; | ||
viewArgs = 'include=field_album_id,field_album_id.field_album_cover,field_artist_id'; | ||
|
||
pathForType() { | ||
return 'songs/songs_neb_5?include=field_album_id,field_album_id.field_album_cover,field_artist_id'; | ||
return `${this.viewType}/${this.viewId}?${this.viewArgs}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,32 @@ | ||
import Route from '@ember/routing/route'; | ||
import { service } from '@ember/service'; | ||
import { action } from '@ember/object'; | ||
|
||
export default class SongsRoute extends Route { | ||
@service store; | ||
@service headData; | ||
|
||
// beforeModel() { | ||
// this.store.unloadAll('song'); | ||
// } | ||
|
||
model() { | ||
console.log('this.store', this.store); | ||
|
||
return this.store.findAll('song'); | ||
} | ||
|
||
afterModel() { | ||
this.headData.routeTitle = 'Songs'; | ||
} | ||
|
||
@action | ||
loading(transition) { | ||
transition.promise.finally(() => { | ||
let start = new Date(); | ||
console.log(`Took ${new Date() - start}ms to load`); | ||
}); | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters