Copies the value of the foreign keys, as defined in baseQuery, provided by request.params, to the request.payload model.
function setForeignKeys (request, baseQuery) {
  if (typeof baseQuery === 'undefined') {
    return
  }
  
  _.forEach(baseQuery(request), function(v, k) {
    request.payload[k] = request.params[k]
  })
}