"use strict";
const {
  findRealEstatesForSearchRequest
} = require("../helpers/db/searchRequestMatch");
const { AD_STATUS } = require("../common/enums");

const getRealEstates = async (req, res) => {
  const searchRequestId = req.params["searchRequestId"] || "";
  const realEstates = await findRealEstatesForSearchRequest(searchRequestId);

  const title = "Nekretnine koje odgovaraju Vašim uslovima pretrage";
  res.render("realEstates", { realEstates, title, AD_STATUS });
};

module.exports = {
  getRealEstates
};
