2018-03-25 18:03:08 +00:00
|
|
|
// License: LGPL-3.0-or-later
|
2018-03-25 17:30:42 +00:00
|
|
|
const request = require('../common/request')
|
|
|
|
const flyd = require('flyd')
|
|
|
|
const R = require('ramda')
|
|
|
|
var path = `/nonprofits/${app.nonprofit_id}/campaigns/${ENV.campaignID}/totals`
|
|
|
|
|
|
|
|
const resp$ = flyd.map(R.prop('body'), request({path, method: 'GET'}).load)
|
|
|
|
|
|
|
|
appl.def('loading_totals', true)
|
|
|
|
|
|
|
|
flyd.map(response => {
|
|
|
|
appl.def('loading_totals', false)
|
|
|
|
appl.def('campaign_totals', response)
|
|
|
|
}, resp$)
|
|
|
|
|