This commit is contained in:
@ -605,12 +605,11 @@ const handleMapClick = async (coords) => {
|
|||||||
|
|
||||||
const allTerms = [...new Set([...selectedTerms, ...customTerms])];
|
const allTerms = [...new Set([...selectedTerms, ...customTerms])];
|
||||||
|
|
||||||
|
const isRent = purpose === 'rent';
|
||||||
const details = {
|
const details = {
|
||||||
description: formData.description || '',
|
description: formData.description || '',
|
||||||
services: selectedServices,
|
services: selectedServices,
|
||||||
serviceDetails: selectedServices.reduce((acc, s) => ({ ...acc, [s]: formData.serviceDetails[s] || 'in general' }), {}),
|
serviceDetails: selectedServices.reduce((acc, s) => ({ ...acc, [s]: formData.serviceDetails[s] || 'in general' }), {}),
|
||||||
terms: allTerms.reduce((acc, k) => ({ ...acc, [k]: true }), {}),
|
|
||||||
displayType: formData.offerType === 'both' ? 'Both' : formData.offerType === 'daily' ? 'Daily' : 'Monthly',
|
|
||||||
propertyCondition: formData.furnished ? 'WithFurniture' : 'WithoutFurniture',
|
propertyCondition: formData.furnished ? 'WithFurniture' : 'WithoutFurniture',
|
||||||
floorNumber: parseInt(formData.floorNumber) || 0,
|
floorNumber: parseInt(formData.floorNumber) || 0,
|
||||||
numberOfSalons: parseInt(formData.salons) || 0,
|
numberOfSalons: parseInt(formData.salons) || 0,
|
||||||
@ -625,7 +624,12 @@ const handleMapClick = async (coords) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (formData.propertyType === 'room') {
|
if (isRent) {
|
||||||
|
details.terms = allTerms.reduce((acc, k) => ({ ...acc, [k]: true }), {});
|
||||||
|
details.displayType = formData.offerType === 'both' ? 'Both' : formData.offerType === 'daily' ? 'Daily' : 'Monthly';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isRent && formData.propertyType === 'room') {
|
||||||
details.room = {
|
details.room = {
|
||||||
areaType: formData.roomAreaType || 'Private room',
|
areaType: formData.roomAreaType || 'Private room',
|
||||||
peopleAllowed: formData.roomPeopleAllowed || String(formData.bedrooms),
|
peopleAllowed: formData.roomPeopleAllowed || String(formData.bedrooms),
|
||||||
|
|||||||
Reference in New Issue
Block a user