Fix add property page to match Flutter request body structure
Some checks failed
Build frontend / build (push) Failing after 39s

- Remove 'For sale' offer type (rent only)
- Remove salePrice field and UI
- Fix rentTypeMap: 0=Monthly, 1=Daily (was wrong)
- Fix propertyType: uses RentPropertyCondition (furnished/unfurnished)
- Fix type field: uses RentPropertyType (furnished/unfurnished)
- Fix services: use enum API names in detailsJSON (Electricity, Internet...)
- Fix terms: use enum API names in detailsJSON (NoSmoking, NoAnimals...)
- Fix detailsJSON structure to match Flutter (services array, terms array, room object)
- Replace getCurrencies with static Currency enum dropdown
- Remove duplicate MapClickHandler
- Use all new enums from enums/index.js
This commit is contained in:
Claw AI
2026-03-29 15:48:48 +00:00
parent 5d7b3e3b0f
commit 00dab824c3
2 changed files with 118 additions and 124 deletions

View File

@ -116,6 +116,22 @@ export async function getProperty(id) {
return apiFetch(`/Properties/Get/${id}`);
}
// ─── Rent Properties (Add) ───
/**
* Add a rent property
* Request body must match Flutter AddRentPropertyDto exactly
* @param {object} data — structured request body
* @returns {Promise<object>}
*/
export async function addRentProperty(data) {
console.log('[API] Adding rent property...');
return apiFetch('/RentProperties/AddRentProperty', {
method: 'POST',
body: JSON.stringify(data),
});
}
// ─── Recommendations ───
export async function getRecommendations() {