const { currentRERequest } = require('../helpers/url'); const { prices } = require('../helpers/enums'); const getPrice = (req,res) => { const nextStep = req.query.nextStep; res.render('price', { nextStep, prices }); }; const postPrice = async (req, res) => { const request = await currentRERequest(req); const nextStep = req.query.nextStep || `/pregled/${request.uniqueId}`; request.price = req.body.price; await request.save(); res.redirect(nextStep); }; module.exports = { getPrice, postPrice };