forked from amer2004/SweetHome
Added api for add property
This commit is contained in:
@ -56,6 +56,7 @@ import {
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import AuthService from "../../services/AuthService";
|
||||
import {
|
||||
buildRentPropertyPayload,
|
||||
getMyRentListings,
|
||||
getMySaleListings,
|
||||
editRentProperty,
|
||||
@ -1588,8 +1589,11 @@ export default function OwnerPropertiesPage() {
|
||||
|
||||
if (formData.purpose === 'rent') {
|
||||
const rentTypeMap = { daily: 1, monthly: 0, both: 0 };
|
||||
const payload = {
|
||||
const payload = buildRentPropertyPayload({
|
||||
propertyInformation: propInfo,
|
||||
city: formData.city || property?.city || property?.governorate || "",
|
||||
governorate: formData.city || property?.city || property?.governorate || "",
|
||||
documentType: formData.documentType || property?.documentType || "",
|
||||
deposit: parseFloat(formData.deposit) || 0,
|
||||
monthlyRent: parseFloat(formData.monthlyPrice) || 0,
|
||||
dailyRent: parseFloat(formData.dailyPrice) || 0,
|
||||
@ -1599,7 +1603,7 @@ export default function OwnerPropertiesPage() {
|
||||
rentType: rentTypeMap[formData.rentType] ?? 0,
|
||||
type: formData.furnished ? 0 : 1,
|
||||
allowedPaymentPeriod: formData.allowedPaymentPeriod || '',
|
||||
};
|
||||
});
|
||||
await editRentProperty(property.id, payload);
|
||||
} else {
|
||||
const payload = {
|
||||
|
||||
Reference in New Issue
Block a user