liquid-funding/app/utils/fundProfiles.js

11 lines
310 B
JavaScript
Raw Normal View History

2018-12-07 14:47:00 +00:00
import { evolve, map, when, propEq, set, lensProp } from 'ramda'
export const cancelProfile = (state, id) => {
const updateMatch = when(
propEq('idProfile', id),
set(lensProp('canceled'), true)
)
const transformation = { fundProfiles: map(updateMatch) }
return evolve(transformation, state)
}