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

This commit is contained in:
mouazkh
2026-05-26 01:48:12 +03:00
parent ca94c5fd87
commit 4c350d7589
2 changed files with 46 additions and 45 deletions

View File

@ -648,19 +648,19 @@ const handleMapClick = async (coords) => {
const detailsJSON = JSON.stringify(details); const detailsJSON = JSON.stringify(details);
const propInfo = { const propInfo = {
cordsX: formData.lat ? String(formData.lat) : '', CordsX: formData.lat ? String(formData.lat) : '',
cordsY: formData.lng ? String(formData.lng) : '', CordsY: formData.lng ? String(formData.lng) : '',
images: uploadedImagePaths, Images: uploadedImagePaths,
address: `${formData.city} - ${formData.district} - ${formData.address}`.trim(), Address: `${formData.city} - ${formData.district} - ${formData.address}`.trim(),
description: formData.description || '', Description: formData.description || '',
numberOfBathRooms: formData.bathrooms || 0, NumberOfBathRooms: formData.bathrooms || 0,
numberOfRooms: formData.bedrooms || 0, NumberOfRooms: formData.bedrooms || 0,
numberOfBedRooms: formData.bedrooms || 0, NumberOfBedRooms: formData.bedrooms || 0,
space: parseFloat(formData.space) || 0, Space: parseFloat(formData.space) || 0,
detailsJSON, DetailsJSON: detailsJSON,
buildingType: buildingTypeMap[formData.propertyType] ?? BuildingType.APARTMENT, BuildingType: buildingTypeMap[formData.propertyType] ?? BuildingType.APARTMENT,
status: 0, Status: 0,
propertyType: formData.furnished ? RentPropertyCondition.WITH_FURNITURE : RentPropertyCondition.WITHOUT_FURNITURE, PropertyType: formData.furnished ? RentPropertyCondition.WITH_FURNITURE : RentPropertyCondition.WITHOUT_FURNITURE,
}; };
try { try {
@ -677,15 +677,15 @@ const handleMapClick = async (coords) => {
} else { } else {
const rentTypeMap = { daily: RentType.DAILY, monthly: RentType.MONTHLY, both: RentType.MONTHLY }; const rentTypeMap = { daily: RentType.DAILY, monthly: RentType.MONTHLY, both: RentType.MONTHLY };
const rentBody = { const rentBody = {
propertyInformation: propInfo, PropertyInformation: propInfo,
deposit: parseFloat(formData.deposit) || 0, Deposit: parseFloat(formData.deposit) || 0,
monthlyRent: parseFloat(formData.monthlyPrice) || 0, MonthlyRent: parseFloat(formData.monthlyPrice) || 0,
dailyRent: parseFloat(formData.dailyPrice) || 0, DailyRent: parseFloat(formData.dailyPrice) || 0,
rating: 1, Rating: 1,
currencyId: selectedCurrencyId, CurrencyId: selectedCurrencyId,
rentType: rentTypeMap[formData.offerType] ?? RentType.MONTHLY, RentType: rentTypeMap[formData.offerType] ?? RentType.MONTHLY,
type: formData.furnished ? RentPropertyType.FURNISHED : RentPropertyType.UNFURNISHED, Type: formData.furnished ? RentPropertyType.FURNISHED : RentPropertyType.UNFURNISHED,
allowedPaymentPeriod: '01:00:00:00', AllowedPaymentPeriod: '01:00:00:00',
}; };
const payload = { rentPropertyDto: rentBody }; const payload = { rentPropertyDto: rentBody };
console.log('[AddProperty] Rent payload:', JSON.stringify(payload, null, 2)); console.log('[AddProperty] Rent payload:', JSON.stringify(payload, null, 2));

View File

@ -1270,46 +1270,47 @@ export default function OwnerPropertiesPage() {
}; };
const detailsJSON = JSON.stringify(details); const detailsJSON = JSON.stringify(details);
const payload = { const editBody = {
propertyInformation: { PropertyInformation: {
cordsX: raw.propertyInformation?.cordsX || "", CordsX: raw.propertyInformation?.cordsX || "",
cordsY: raw.propertyInformation?.cordsY || "", CordsY: raw.propertyInformation?.cordsY || "",
address: Address:
updatedProperty.address || raw.propertyInformation?.address || "", updatedProperty.address || raw.propertyInformation?.address || "",
description: Description:
updatedProperty.description || updatedProperty.description ||
raw.propertyInformation?.description || raw.propertyInformation?.description ||
"", "",
numberOfBathRooms: NumberOfBathRooms:
updatedProperty.bathrooms || updatedProperty.bathrooms ||
raw.propertyInformation?.numberOfBathRooms || raw.propertyInformation?.numberOfBathRooms ||
0, 0,
numberOfRooms: updatedProperty.bedrooms || 0, NumberOfRooms: updatedProperty.bedrooms || 0,
numberOfBedRooms: NumberOfBedRooms:
updatedProperty.bedrooms || updatedProperty.bedrooms ||
raw.propertyInformation?.numberOfBedRooms || raw.propertyInformation?.numberOfBedRooms ||
0, 0,
space: Space:
parseFloat(updatedProperty.area) || parseFloat(updatedProperty.area) ||
raw.propertyInformation?.space || raw.propertyInformation?.space ||
0, 0,
detailsJSON, DetailsJSON: detailsJSON,
buildingType: buildingTypeMap[updatedProperty.propertyType] ?? 0, BuildingType: buildingTypeMap[updatedProperty.propertyType] ?? 0,
status: updatedProperty.status === "available" ? 0 : 1, Status: updatedProperty.status === "available" ? 0 : 1,
propertyType: updatedProperty.furnished ? 0 : 1, PropertyType: updatedProperty.furnished ? 0 : 1,
images: raw.propertyInformation?.images || [], Images: raw.propertyInformation?.images || [],
}, },
deposit: parseFloat(updatedProperty.deposit) || raw.deposit || 0, Deposit: parseFloat(updatedProperty.deposit) || raw.deposit || 0,
monthlyRent: MonthlyRent:
parseFloat(updatedProperty.monthlyPrice) || raw.monthlyRent || 0, parseFloat(updatedProperty.monthlyPrice) || raw.monthlyRent || 0,
dailyRent: DailyRent:
parseFloat(updatedProperty.dailyPrice) || raw.dailyRent || 0, parseFloat(updatedProperty.dailyPrice) || raw.dailyRent || 0,
rating: 1, Rating: 1,
currencyId: updatedProperty.currencyId || raw.currencyId || 1, CurrencyId: updatedProperty.currencyId || raw.currencyId || 1,
rentType: rentTypeMap[updatedProperty.rentType] ?? 0, RentType: rentTypeMap[updatedProperty.rentType] ?? 0,
type: updatedProperty.furnished ? 0 : 1, Type: updatedProperty.furnished ? 0 : 1,
allowedPaymentPeriod: "01:00:00:00", AllowedPaymentPeriod: "01:00:00:00",
}; };
const payload = { rentPropertyDto: editBody };
await editRentProperty(updatedProperty.id, payload); await editRentProperty(updatedProperty.id, payload);
} }