houdini/client/js/common/fundraiser_metrics.js

16 lines
384 B
JavaScript
Raw Normal View History

const R = require('ramda')
const format = require('../common/format')
require('../common/restful_resource')
appl.def('ajax_metrics', {
index: function() {
appl.ajax.index('metrics').then(function(resp) {
appl.def('metrics.percentage_funded', R.clamp(1,100, format.percent(
resp.body.goal_amount
, resp.body.total_raised
))
)
})
}
})