lib/mock/edit-resource.js
function mergeResource (req, res, next, dataStore) {
  let resource = createResource(req);

  // Save/Update the resource
  util.debug("Saving data at %s", resource.toString());
  dataStore.save(resource, sendResponse(req, res, next, dataStore));
}
function mergeResource (req, res, next, dataStore) {
  let resource = createResource(req);

  // Save/Update the resource
  util.debug("Saving data at %s", resource.toString());
  dataStore.save(resource, sendResponse(req, res, next, dataStore));
}
function mergeResource ( req , res , next , dataStore ) { let resource = createResource ( req ) ; // Save/Update the resource util . debug ( "Saving data at %s" , resource . toString ( ) ) ; dataStore . save ( resource , sendResponse ( req , res , next , dataStore ) ) ; }
Creates or updates the REST resource at the URL.

If the resource already exists, then the new data is merged with the existing data.
To completely overwrite the existing data, use PUT instead of POST or PATCH.

@param   {Request}   req
@param   {Response}  res
@param   {function}  next
@param   {DataStore} dataStore
Creates or updates the REST resource at the URL .