Email notifications kivi ads #107
@@ -8,7 +8,8 @@ const {
|
||||
BASIC_SEGMENT_PUBLISH,
|
||||
ADDITIONAL_BOOLEAN_PUBLISH,
|
||||
ADDITIONAL_SEGMENT_PUBLISH,
|
||||
BASIC_INPUT_PUBLISH
|
||||
BASIC_INPUT_PUBLISH,
|
||||
ADDITIONAL_INPUT_PUBLISH
|
||||
} = require("../common/publishEnums");
|
||||
|
||||
const getPublishInputs = async (req, res) => {
|
||||
@@ -19,7 +20,7 @@ const getPublishInputs = async (req, res) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const title = "Podaci o nekretnini";
|
||||
const pageTitle = "Podaci o nekretnini";
|
||||
|
||||
const {
|
||||
price,
|
||||
@@ -63,7 +64,9 @@ const getPublishInputs = async (req, res) => {
|
||||
buildingPermit,
|
||||
furnishingType,
|
||||
shortDescription,
|
||||
streetName
|
||||
streetName,
|
||||
title,
|
||||
longDescription
|
||||
} = realEstate;
|
||||
const category = AD_CATEGORY[realEstateType] || AD_CATEGORY.FLAT;
|
||||
|
||||
@@ -135,9 +138,14 @@ const getPublishInputs = async (req, res) => {
|
||||
shortDescription,
|
||||
streetName
|
||||
};
|
||||
//Input type textare to be shown on Additional Data
|
||||
const additionalInputInputs = ADDITIONAL_INPUT_PUBLISH.filter(filterInputs);
|
||||
const additionalInputValues = {
|
||||
longDescription
|
||||
};
|
||||
|
||||
res.render("publishRealEstate", {
|
||||
title,
|
||||
title: pageTitle,
|
||||
basicBooleanPublishInputs,
|
||||
basicBooleanPublishValues,
|
||||
additionalBooleanPublishInputs,
|
||||
@@ -147,7 +155,9 @@ const getPublishInputs = async (req, res) => {
|
||||
additionalSegmentSelectInputs,
|
||||
additionalSegmentSelectValues,
|
||||
basicInputInputs,
|
||||
basicInputValues
|
||||
basicInputValues,
|
||||
additionalInputInputs,
|
||||
additionalInputValues
|
||||
});
|
||||
};
|
||||
|
||||
@@ -203,6 +213,17 @@ const postPublishInputs = async (req, res) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const price = parseFloat(req.body.price);
|
||||
const area = parseFloat(req.body.area);
|
||||
const gardenSize = parseFloat(req.body.gardenSize);
|
||||
const numberOfRooms = parseInt(req.body.numberOfRooms);
|
||||
const numberOfFloors = parseInt(req.body.numberOfFloors);
|
||||
const floor = parseInt(req.body.floor);
|
||||
const title = req.body.title;
|
||||
const shortDescription = req.body.shortDescription;
|
||||
const streetName = req.body.streetName;
|
||||
const longDescription = req.body.longDescription;
|
||||
|
||||
realEstate.balcony = balcony;
|
||||
realEstate.elevator = elevator;
|
||||
realEstate.newBuilding = newBuilding;
|
||||
@@ -234,6 +255,18 @@ const postPublishInputs = async (req, res) => {
|
||||
realEstate.furnishingType = furnishingType;
|
||||
realEstate.accessRoadType = accessRoadType;
|
||||
realEstate.heatingType = heatingType;
|
||||
|
||||
realEstate.price = price;
|
||||
realEstate.area = area;
|
||||
realEstate.gardenSize = gardenSize;
|
||||
realEstate.numberOfRooms = numberOfRooms;
|
||||
realEstate.numberOfFloors = numberOfFloors;
|
||||
realEstate.floor = floor;
|
||||
realEstate.title = title;
|
||||
realEstate.shortDescription = shortDescription;
|
||||
realEstate.streetName = streetName;
|
||||
|
||||
realEstate.longDescription = longDescription;
|
||||
//
|
||||
console.log("postPublishInputs");
|
||||
await realEstate.save();
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
<br>
|
||||
<div class="row">
|
||||
<% for (const input of additionalInputInputs){ %>
|
||||
<div class="input-field col s3 m4 l5">
|
||||
<textarea
|
||||
id="<%= input.dbField %>"
|
||||
form="publishForm"
|
||||
name="<%= input.dbField %>"
|
||||
cols="80" rows="15"
|
||||
value="<%= additionalInputValues[input.dbField] !== undefined ? additionalInputValues[input.dbField] : ""%>"
|
||||
></textarea>
|
||||
<label for="<%= input.dbField %>"><%= input.title %></label>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
<% for (const input of additionalBooleanPublishInputs){ %>
|
||||
|
||||
Reference in New Issue
Block a user