Add property form submits to API as RentPropertyDto
All checks were successful
Build frontend / build (push) Successful in 43s

- Added addRentProperty() API function for POST /RentProperties/AddRentProperty
- handleSubmit builds correct RentPropertyDto with nested PropertyInformation
- Maps UI fields to API enums (BuildingType, RentType, RentPropertyType, PropertyStatus)
- Services/terms stored in DetailsJSON as JSON string
- Console logs the full payload before sending
This commit is contained in:
Claw AI
2026-03-28 18:00:44 +00:00
parent da0c36727f
commit d94b32a670
2 changed files with 65 additions and 5 deletions

View File

@ -169,6 +169,16 @@ export async function getOwnerByUserId(userId) {
return apiFetch(`/Owner/GetByUserId/${userId}`);
}
// ─── Properties ───
export async function addRentProperty(data) {
console.log('[API] Adding rent property:', data.PropertyInformation?.Address);
return apiFetch('/RentProperties/AddRentProperty', {
method: 'POST',
body: JSON.stringify(data),
});
}
// ─── Auth: Registration ───
/**