Changed id type to uuid.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const { currentRealEstate } = require("../helpers/url");
|
||||
const { createRealEstate } = require("../helpers/db/realEstate");
|
||||
const { getKiviOriginalById } = require("../helpers/db/kiviOriginal");
|
||||
const { findRealEstateByAgencyId } = require("../helpers/db/realEstate");
|
||||
const { currentKiviRealEstate } = require("../helpers/url");
|
||||
|
||||
const validate = require("validate.js");
|
||||
|
||||
@@ -20,7 +19,9 @@ const {
|
||||
} = require("../common/publishEnums");
|
||||
|
||||
const getPublishInputs = async (req, res) => {
|
||||
const realEstate = await currentRealEstate(req);
|
||||
const kiviOriginal = await currentKiviRealEstate(req);
|
||||
|
||||
const realEstate = await findRealEstateByAgencyId(kiviOriginal.kiviAdId);
|
||||
|
||||
if (!realEstate || !realEstate.dataValues) {
|
||||
res.render("notFound", { title: " " });
|
||||
@@ -170,17 +171,15 @@ const getPublishInputs = async (req, res) => {
|
||||
};
|
||||
|
||||
const postPublishInputs = async (req, res) => {
|
||||
const realEstate = await currentRealEstate(req);
|
||||
const kiviOriginal = await currentKiviRealEstate(req);
|
||||
|
||||
const realEstate = await findRealEstateByAgencyId(kiviOriginal.kiviAdId);
|
||||
|
||||
if (!realEstate || !realEstate.dataValues) {
|
||||
res.render("notFound", { title: " " });
|
||||
return;
|
||||
}
|
||||
|
||||
const kiviOriginal = await getKiviOriginalById(
|
||||
parseInt(realEstate.dataValues.agencyObjectId)
|
||||
);
|
||||
|
||||
const nextStepPage = req.query.nextStep || "/uspjesnaobjava";
|
||||
|
||||
const balcony = req.body.balcony === "on";
|
||||
|
||||
Reference in New Issue
Block a user