This commit is contained in:
@ -234,7 +234,6 @@ export default function AddPropertyPage() {
|
||||
getCurrencies().then((data) => {
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
setCurrencies(data);
|
||||
console.log('[AddProperty] Currencies loaded:', data);
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.warn('[AddProperty] Failed to load currencies:', err);
|
||||
@ -382,7 +381,6 @@ const handleMapClick = async (coords) => {
|
||||
|
||||
const handleImageUpload = async (files) => {
|
||||
const newImages = Array.from(files);
|
||||
console.log('[AddProperty] handleImageUpload called with', newImages.length, 'files');
|
||||
|
||||
if (formData.images.length + newImages.length > 10) {
|
||||
toast.error('يمكنك رفع 10 صور كحد أقصى');
|
||||
@ -416,7 +414,6 @@ const handleMapClick = async (coords) => {
|
||||
try {
|
||||
const path = await uploadPicture(file);
|
||||
setUploadedImagePaths(prev => [...prev, path]);
|
||||
console.log('[AddProperty] Image uploaded:', path);
|
||||
} catch (err) {
|
||||
console.error('[AddProperty] Image upload failed:', err);
|
||||
toast.error('فشل رفع الصورة: ' + file.name);
|
||||
@ -675,9 +672,7 @@ const handleMapClick = async (coords) => {
|
||||
price: parseFloat(formData.salePrice) || 0,
|
||||
currencyId: selectedCurrencyId,
|
||||
};
|
||||
console.log('[AddProperty] Sale payload:', JSON.stringify(payload, null, 2));
|
||||
const res = await addSaleProperty(payload);
|
||||
console.log('[AddProperty] Sale API response:', res);
|
||||
toast.success('تم إضافة عقار للبيع بنجاح!');
|
||||
} else {
|
||||
const rentTypeMap = { daily: RentType.DAILY, monthly: RentType.MONTHLY, both: RentType.MONTHLY };
|
||||
@ -692,9 +687,7 @@ const handleMapClick = async (coords) => {
|
||||
type: formData.furnished ? RentPropertyType.FURNISHED : RentPropertyType.UNFURNISHED,
|
||||
allowedPaymentPeriod: formData.allowedPaymentPeriod || '',
|
||||
};
|
||||
console.log('[AddProperty] Rent payload:', JSON.stringify(payload, null, 2));
|
||||
const res = await addRentProperty(payload);
|
||||
console.log('[AddProperty] Rent API response:', res);
|
||||
toast.success('تم إضافة عقار للإيجار بنجاح!');
|
||||
}
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user