Added range slider to gardensize and price

This commit is contained in:
Nedim Uka
2019-05-29 11:03:01 +02:00
parent de3c76315e
commit 1a8ac3fba4
10 changed files with 154 additions and 104 deletions

View File

@@ -1,8 +1,22 @@
const { currentRERequest } = require('../helpers/url');
const { prices } = require('../helpers/enums');
const getPrice = (req,res) => {
res.render('price', { prices });
const rangeFrom = {
min : 0,
max : 250000,
value : 0,
step : 1000
}
const rangeTo = {
min : 0,
max : 250000,
value : 50000,
step : 1000
}
res.render('price', {rangeFrom, rangeTo });
};
const postPrice = async (req, res) => {
@@ -11,7 +25,8 @@ const postPrice = async (req, res) => {
const nextStepPage = req.query.nextStep || 'pregled';
const nextStepUrl = `/${nextStepPage}/${request.uniqueId}`;
request.price = req.body.price;
request.price = req.body.from;
request.priceRange = req.body.to;
await request.save();
res.redirect(nextStepUrl);