client/actions/dashboard.js
// Also dispatches getShoppingListTotals() once shopping list deleted, so that total savings is updated.
Also dispatches getShoppingListTotals() once shopping list deleted, so that total savings is updated.
Also dispatches getShoppingListTotals () once shopping list deleted so that total savings is updated .
function deleteShoppingListById (id) {
  return (dispatch) => {
    return request('delete', `v1/shoppinglists/${id}`)
      .then (res => {
        dispatch(deleteShoppingListByIdInStore(id))
        dispatch(getShoppingListTotals())
      })
      .catch(err => {
        dispatch(showError(err.message))
      })
    }
}
function deleteShoppingListById ( id ) { return ( dispatch ) => { return request ( 'delete' , ` ${ id } ` ) . then ( res => { dispatch ( deleteShoppingListByIdInStore ( id ) ) dispatch ( getShoppingListTotals ( ) ) } ) . catch ( err => { dispatch ( showError ( err . message ) ) } ) } }
Also dispatches getShoppingListTotals() once shopping list deleted, so that total savings is updated.
Also dispatches getShoppingListTotals () once shopping list deleted so that total savings is updated .