diff --git a/app/controllers/publishRealEstate.js b/app/controllers/publishRealEstate.js
new file mode 100644
index 0000000..90cf359
--- /dev/null
+++ b/app/controllers/publishRealEstate.js
@@ -0,0 +1,34 @@
+const { currentRealEstate } = require("../helpers/url");
+const { createRealEstate } = require("../helpers/db/realEstate");
+const { createKiviOriginal } = require("../helpers/db/kiviOriginal");
+
+const { AD_CATEGORY, AD_TYPE, AD_AGENCY } = require("../common/enums");
+
+const getPublishInputs = async (req, res) => {
+ const realEstate = await currentRealEstate(req);
+
+ if (!realEstate || !realEstate.dataValues) {
+ res.render("notFound", { title: " " });
+ return;
+ }
+
+ const title = "Podaci o nekretnini";
+
+ res.render("publishRealEstate", {
+ title
+ });
+};
+
+const postPublishInputs = async (req, res) => {
+ const realEstate = await currentRealEstate(req);
+
+ if (!realEstate || !realEstate.dataValues) {
+ res.render("notFound", { title: " " });
+ return;
+ }
+};
+
+module.exports = {
+ getPublishInputs,
+ postPublishInputs
+};
diff --git a/app/controllers/publishRealEstateTypes.js b/app/controllers/publishRealEstateTypes.js
index 7965add..d38c3a3 100644
--- a/app/controllers/publishRealEstateTypes.js
+++ b/app/controllers/publishRealEstateTypes.js
@@ -53,10 +53,8 @@ const postPublishTypes = async (req, res) => {
res.render("notFound", { title: " " });
return;
}
- // Sta je nextStepPage - treba napraviti !!!!
- /////
- /////
- const nextStepPage = req.query.nextStep || "/lokacija";
+
+ const nextStepPage = req.query.nextStep || "podacionekretnini";
let nextStepUrl = "";
if (realEstate && realEstate.id) {
@@ -79,7 +77,7 @@ const postPublishTypes = async (req, res) => {
agencyObjectId: newKiviOriginal.kiviAdId
});
- //Da li ovaj id ili kivioriginal id
+ //Da li ovaj id ili kivioriginal id ???
nextStepUrl = `/${nextStepPage}/${newRealEstate.id}`;
} catch (error) {
console.log(error);
diff --git a/app/routes/index.js b/app/routes/index.js
index 65b67a2..b068e32 100644
--- a/app/routes/index.js
+++ b/app/routes/index.js
@@ -11,6 +11,10 @@ const {
getPublishTypes,
postPublishTypes
} = require("../controllers/publishRealEstateTypes");
+const {
+ getPublishInputs,
+ postPublishInputs
+} = require("../controllers/publishRealEstate");
const {
getQueryReview,
postQueryReview
@@ -37,6 +41,9 @@ router.get("/objavinekretninu", getPublishTypes);
router.post("/objavinekretninu/:realEstateId", postPublishTypes);
router.post("/objavinekretninu", postPublishTypes);
+router.get("/podacionekretnini/:realEstateId", getPublishInputs);
+router.post("/podacionekretnini/:realEstateId", postPublishInputs);
+
router.get("/lokacija/:searchRequestId", getLocation);
router.post("/lokacija/:searchRequestId", postLocation);
diff --git a/app/views/publishRealEstate.ejs b/app/views/publishRealEstate.ejs
new file mode 100644
index 0000000..c47862c
--- /dev/null
+++ b/app/views/publishRealEstate.ejs
@@ -0,0 +1,4 @@
+
+