Created
July 6, 2017 05:30
-
-
Save bmx269/62130c6aa7cb04b80811dc1ccf819173 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
saveVote: task(function * () { | |
var queueVotes = this.get('voteItems').map(item => { | |
item.set('isSelected', false); | |
let itemId = item.get('id'); | |
let itemTitle = item.get('title'); | |
let itemImage = item.get('fieldImage.url'); | |
let currentCampaign = this.get('campaign.id'); | |
let newVote= this.store.createRecord('node--vote', { | |
title: itemTitle, | |
fieldItemid: itemId, | |
fieldCampaignid: currentCampaign, | |
fieldImageUrl: itemImage | |
}); | |
}); | |
yield queueVotes.save() | |
yield timeout(DEBOUNCE_TIMEOUT); | |
return {}; | |
}).enqueue().maxConcurrency(1), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment