Created
April 23, 2015 22:55
-
-
Save JackLaBarba/c1b3ad311340021b461f to your computer and use it in GitHub Desktop.
Ember.$ + pushPayload
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
fetchImages: function() { | |
var modelURL = this.store.adapterFor('collection-item').buildURL('collection-item', this.get('id')); | |
var promise = new Ember.RSVP.Promise((resolve, reject) => { | |
Ember.$.post(`${modelURL}/scrape_images`).then((payload) => { | |
Ember.run(() => this.store.pushPayload('collection-item', payload)); | |
resolve(this); | |
}, reject); | |
}); | |
return this.isLoadingWhile(promise); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment