| @@ -129,6 +129,7 @@ app.post("/scrapes/", async (req, res) => { | |||
| const beds = req.body.beds; | |||
| const type = req.body.type; | |||
| const lifestyle = req.body.lifestyle; | |||
| const baths = req.body.baths; | |||
| // query builder | |||
| var query = `https://www.apartments.com`; | |||
| @@ -143,6 +144,10 @@ app.post("/scrapes/", async (req, res) => { | |||
| query += `/${beds}-bedrooms`; | |||
| } | |||
| if (baths) { | |||
| query += `${beds ? '-' : '/'}${baths}-bathrooms`; | |||
| } | |||
| if (price) { | |||
| if (beds) { | |||
| query += `-over-${price}`; | |||
| @@ -190,6 +195,7 @@ app.post("/scrapes/", async (req, res) => { | |||
| location: location, | |||
| description: description, | |||
| filters: [ | |||
| { name: 'baths', value: baths }, | |||
| { name: 'price', value: price }, | |||
| { name: 'beds', value: beds }, | |||
| { name: 'type', value: type }, | |||