mirror of https://github.com/pelias/api.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
961 B
25 lines
961 B
var _ = require('lodash'); |
|
|
|
function setup( paramName, targetMap ) { |
|
return function( raw, clean ){ |
|
return sanitize( raw, clean ); |
|
}; |
|
} |
|
|
|
function sanitize( raw, clean, opts ) { |
|
// error & warning messages |
|
var messages = { errors: [], warnings: [] }; |
|
|
|
if (_.includes(raw.sources, 'quattroshapes') || _.includes(raw.sources, 'qs')) { |
|
messages.warnings.push( 'You are using Quattroshapes as a data source in this query. ' + |
|
'Quattroshapes will be disabled as a data source for Mapzen Search in the next several ' + |
|
'weeks, and is being replaced by Who\'s on First, an actively maintained data project ' + |
|
'based on Quattroshapes. Your existing queries WILL CONTINUE TO WORK for the foreseeable ' + |
|
'future, but results will be coming from Who\'s on First and `sources=quattroshapes` will ' + |
|
'be deprecated. If you have any questions, please email search@mapzen.com.'); |
|
} |
|
|
|
return messages; |
|
} |
|
|
|
module.exports = setup;
|
|
|