Added range slider to gardensize and price
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user