Add property form submits to API as RentPropertyDto
All checks were successful
Build frontend / build (push) Successful in 43s
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:
@ -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 ───
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user