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

This commit is contained in:
mouazkh
2026-05-26 02:34:18 +03:00
parent 4c350d7589
commit 80ea9af86b
2 changed files with 52 additions and 48 deletions

View File

@ -648,19 +648,19 @@ const handleMapClick = async (coords) => {
const detailsJSON = JSON.stringify(details);
const propInfo = {
CordsX: formData.lat ? String(formData.lat) : '',
CordsY: formData.lng ? String(formData.lng) : '',
Images: uploadedImagePaths,
Address: `${formData.city} - ${formData.district} - ${formData.address}`.trim(),
Description: formData.description || '',
NumberOfBathRooms: formData.bathrooms || 0,
NumberOfRooms: formData.bedrooms || 0,
NumberOfBedRooms: formData.bedrooms || 0,
Space: parseFloat(formData.space) || 0,
DetailsJSON: detailsJSON,
BuildingType: buildingTypeMap[formData.propertyType] ?? BuildingType.APARTMENT,
Status: 0,
PropertyType: formData.furnished ? RentPropertyCondition.WITH_FURNITURE : RentPropertyCondition.WITHOUT_FURNITURE,
cordsX: formData.lat ? String(formData.lat) : '',
cordsY: formData.lng ? String(formData.lng) : '',
images: uploadedImagePaths,
address: `${formData.city} - ${formData.district} - ${formData.address}`.trim(),
description: formData.description || '',
numberOfBathRooms: formData.bathrooms || 0,
numberOfRooms: formData.bedrooms || 0,
numberOfBedRooms: formData.bedrooms || 0,
space: parseFloat(formData.space) || 0,
detailsJSON,
buildingType: buildingTypeMap[formData.propertyType] ?? BuildingType.APARTMENT,
status: 0,
propertyType: formData.furnished ? RentPropertyCondition.WITH_FURNITURE : RentPropertyCondition.WITHOUT_FURNITURE,
};
try {
@ -676,18 +676,20 @@ const handleMapClick = async (coords) => {
toast.success('تم إضافة عقار للبيع بنجاح!');
} else {
const rentTypeMap = { daily: RentType.DAILY, monthly: RentType.MONTHLY, both: RentType.MONTHLY };
const rentBody = {
PropertyInformation: propInfo,
Deposit: parseFloat(formData.deposit) || 0,
MonthlyRent: parseFloat(formData.monthlyPrice) || 0,
DailyRent: parseFloat(formData.dailyPrice) || 0,
Rating: 1,
CurrencyId: selectedCurrencyId,
RentType: rentTypeMap[formData.offerType] ?? RentType.MONTHLY,
Type: formData.furnished ? RentPropertyType.FURNISHED : RentPropertyType.UNFURNISHED,
AllowedPaymentPeriod: '01:00:00:00',
const payload = {
propertyInformation: propInfo,
deposit: parseFloat(formData.deposit) || 0,
monthlyRent: parseFloat(formData.monthlyPrice) || 0,
dailyRent: parseFloat(formData.dailyPrice) || 0,
rating: 1,
currencyId: selectedCurrencyId,
rentType: rentTypeMap[formData.offerType] ?? RentType.MONTHLY,
type: formData.furnished ? RentPropertyType.FURNISHED : RentPropertyType.UNFURNISHED,
allowedPaymentPeriod: '',
isSmokeAllow: null,
specializedFor: null,
isVisitorAllow: null,
};
const payload = { rentPropertyDto: rentBody };
console.log('[AddProperty] Rent payload:', JSON.stringify(payload, null, 2));
const res = await addRentProperty(payload);
console.log('[AddProperty] Rent API response:', res);