fixed some changes in the ccode
All checks were successful
Build frontend / build (push) Successful in 55s

This commit is contained in:
mouazkh
2026-07-25 14:54:27 +03:00
parent b4bb3ec279
commit f91dfaacad

View File

@ -332,9 +332,44 @@ export async function addRentProperty(data) {
}
export async function editRentProperty(id, data) {
const pi = data?.propertyInformation || {};
const images = Array.isArray(pi.images) ? pi.images : [];
const body = {
propertyInformation: {
activityStatus: 1,
images: images.length > 0 ? images : [""],
cordsX: pi.cordsX ?? null,
cordsY: pi.cordsY ?? null,
address: pi.address ?? "",
description: pi.description ?? null,
numberOfBathRooms: pi.numberOfBathRooms ?? 0,
numberOfRooms: pi.numberOfRooms ?? 0,
numberOfBedRooms: pi.numberOfBedRooms ?? 0,
space: pi.space ?? 0,
detailsJSON: pi.detailsJSON ?? "",
buildingType: pi.buildingType ?? 0,
status: pi.status ?? 0,
propertyType: pi.propertyType ?? 0,
city: data.city ?? pi.city ?? 1,
},
deposit: data.deposit ?? 0,
acceptedCertificate: data.acceptedCertificate ?? 0,
monthlyRent: data.monthlyRent ?? 0,
dailyRent: data.dailyRent ?? 0,
rating: data.rating ?? 1,
currencyId: data.currencyId ?? 1,
rentType: data.rentType ?? 0,
isSmokeAllow: data.isSmokeAllow ?? false,
specializedFor: data.specializedFor ?? null,
isVisitorAllow: data.isVisitorAllow ?? false,
allowedPaymentPeriod: data.allowedPaymentPeriod ?? "",
type: data.type ?? 0,
};
return apiFetch(`/RentProperties/EditRentProperty/${id}`, {
method: "PUT",
body: { rentPropertyDto: buildRentPropertyPayload(data) },
body,
});
}