Browse Source

Slice extra -000 in search string

stuff
xcps 7 years ago
parent
commit
c4e33e0f6f
  1. 5
      routes/search.js

5
routes/search.js

@ -5,7 +5,10 @@ var router = express.Router(); @@ -5,7 +5,10 @@ var router = express.Router();
/* GET home page. */
router.post('/', async function(req, res, next) {
const search = encodeURI(req.body.search);
let search = encodeURI(req.body.search).trim();
if (search.endsWith('-000')) {
search = search.slice(0, -4);
}
// looking for address
const address = await models.Address.findOne({

Loading…
Cancel
Save