function putResource(formObj, url, callback) {
  const { key, actionName } = getActionAndKeyFromUrl('PUT', url);
  const transformedObject = turnStringToBoolean(formObj);
  const requestObject = {
    verb: 'PUT',
    formObj: transformedObject,
    url,
  };

  return (dispatch) => {
    requestWithPayload(requestObject, callback)
    .then((res) => {
      const action = createActionWithPayload(actionName, key, res);
      dispatch(action);
      callback('/' + url.split('/')[ONE] + '/' + res.id);
      dispatch(handleMessage('Successfully PUTted ' + key + ': ' + res.id));
    })
    .catch((err) => {
      dispatch(handleError(err));
    });
  };
}
/**
 * Figures out resource: aspect or subject, based on the url.
 * Dipatches PATCH request to the supplied url
 * Calls helper function to turn string'd false/true into boolean values
 *
 * @param {Object} formObj The JSON representation of the form
 * @param {String} url The relative url to the to-be-deleted resource:
 * ie. /subjects/73edeac7-de73-41f6-bf99-33d4a5557434
 * @param {Function} callback The function to call, on successful response
 * On returned response, dispatch success or error handlers.
 */
Figures out resource: aspect or subject, based on the url.
Dipatches PATCH request to the supplied url
Calls helper function to turn string'd false/true into boolean values

@param {Object} formObj The JSON representation of the form
@param {String} url The relative url to the to-be-deleted resource:
ie. /subjects/73edeac7-de73-41f6-bf99-33d4a5557434
@param {Function} callback The function to call, on successful response
On returned response, dispatch success or error handlers.
Figures out resource : aspect or subject based on the url . Dipatches PATCH request to the supplied url Calls helper function to turn string ' d false / true into boolean values @param { Object } formObj The JSON representation of the form @param { String } url The relative url to the to - be - deleted resource : ie . / subjects / 73edeac7 - de73 - 41f6 - bf99 - 33d4a5557434 @param { Function } callback The function to call on successful response On returned response dispatch success or error handlers .
function putResource(formObj, url, callback) {
  const { key, actionName } = getActionAndKeyFromUrl('PUT', url);
  const transformedObject = turnStringToBoolean(formObj);
  const requestObject = {
    verb: 'PUT',
    formObj: transformedObject,
    url,
  };
  return (dispatch) => {
    requestWithPayload(requestObject, callback)
    .then((res) => {
      const action = createActionWithPayload(actionName, key, res);
      dispatch(action);
      callback('/' + url.split('/')[ONE] + '/' + res.id);
      dispatch(handleMessage('Successfully PUTted ' + key + ': ' + res.id));
    })
    .catch((err) => {
      dispatch(handleError(err));
    });
  };
}
function putResource ( formObj , url , callback ) { const { key , actionName } = getActionAndKeyFromUrl ( 'PUT' , url ) ; const transformedObject = turnStringToBoolean ( formObj ) ; const requestObject = { verb : 'PUT' , formObj : transformedObject , url , } ; return ( dispatch ) => { requestWithPayload ( requestObject , callback ) . then ( ( res ) => { const action = createActionWithPayload ( actionName , key , res ) ; dispatch ( action ) ; callback ( '/' + url . split ( '/' ) [ ONE ] + '/' + res . id ) ; dispatch ( handleMessage ( 'Successfully PUTted ' + key + ': ' + res . id ) ) ; } ) . catch ( ( err ) => { dispatch ( handleError ( err ) ) ; } ) ; } ; }
Figures out resource: aspect or subject, based on the url.
Figures out resource : aspect or subject based on the url .