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