fixed the details
All checks were successful
Build frontend / build (push) Successful in 45s

This commit is contained in:
mouazkh
2026-05-26 03:22:14 +03:00
parent 5045e69191
commit 71ce933c6a

View File

@ -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),