Started edit ad option.

This commit is contained in:
Naida Vatric
2020-03-19 15:24:58 +01:00
parent f2d9369d5c
commit 55cb01c3c2
5 changed files with 59 additions and 6 deletions

View File

@@ -82,6 +82,15 @@ const getPublishInputs = async (req, res) => {
title,
longDescription
} = realEstate;
const { email } = kiviOriginal;
//If email is not empty - has string value, then proces of publishing has been conducted alredy
//That means user is editing existing real estate ad not publishing new one
let editingRealEstate = false;
if (email) {
editingRealEstate = true;
}
const category = AD_CATEGORY[realEstateType] || AD_CATEGORY.FLAT;
// TODO: Maybe this is slow, pay attention to this
@@ -172,7 +181,11 @@ const getPublishInputs = async (req, res) => {
basicInputValues,
additionalInputInputs,
additionalInputValues,
validate: validate
validate: validate,
email,
locationLat: locationLat || 0,
locationLong: locationLong || 0,
editingRealEstate
});
};