This commit is contained in:
@ -605,12 +605,11 @@ const handleMapClick = async (coords) => {
|
||||
|
||||
const allTerms = [...new Set([...selectedTerms, ...customTerms])];
|
||||
|
||||
const isRent = purpose === 'rent';
|
||||
const details = {
|
||||
description: formData.description || '',
|
||||
services: selectedServices,
|
||||
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',
|
||||
floorNumber: parseInt(formData.floorNumber) || 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 = {
|
||||
areaType: formData.roomAreaType || 'Private room',
|
||||
peopleAllowed: formData.roomPeopleAllowed || String(formData.bedrooms),
|
||||
|
||||
Reference in New Issue
Block a user