Fix add property page to match Flutter request body structure
Some checks failed
Build frontend / build (push) Failing after 39s
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:
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user