- Import getCurrencies and uploadPicture were missing from import statement
- Added currencies state and fetch call in useEffect
- Added debug log in handleImageUpload
- All mappers extract images from propertyInformation.images
- Paths prefixed with API base URL (http://45.93.137.91/api)
- Falls back to placeholder if no images
- Updated: main page, properties listing, property detail, owner properties
- Added uploadPicture() API function for POST /Files/UploadPicture
- Images uploaded immediately on selection, paths stored
- PropertyInformation.images sent with server-side paths
- Remove image also removes from uploaded paths
- Calls /RentProperties/GetMyRentListings/{userId} with user ID from JWT
- Maps API response (nested propertyInformation + detailsJSON) to UI format
- Removed mock data and localStorage fallback
- Overlay blocks entire calendar with 'login to view dates' message
- Date cells disabled when not authenticated
- Clicking overlay or any disabled date shows login/register dialog
- Fixed endpoint: /Reservations/BookReservation/book (was /Reservations/Book)
- bookReservation now takes (propertyId, startDate, endDate) params
- Pricing updates dynamically based on selected date range
- Deposit read from API response instead of hardcoded
- Removed demo fallback that always showed success
- Fetches available date ranges from /Reservations/GetAvailableDates/available/{id}
- Custom month calendar with green (available), amber (selected), gray (unavailable)
- Click start date then end date to select a range
- Validates entire range is available before confirming
- Shows selected dates and day count
- Month navigation with prev/next arrows
- AuthService: added cacheUser/getCachedUser methods
- AuthService.getUser() prefers cached name over JWT claims
- Login page: fetches full profile from API after login and caches it
- Fixes navbar dropdown and homepage showing email instead of name
- ClientLayout: separated user loading into useEffect with pathname dependency
- Homepage: same fix - re-read user from JWT on route change
- Fixes issue where navbar/dashboard links didn't appear until page reload
- Added getCurrencies() API function for /Currency/GetAll
- Currency dropdown fetched on mount, populated with available currencies
- Added deposit input field (مبلغ الضمان)
- CurrencyId sent in RentPropertyDto instead of hardcoded 1
- 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
- Removed FALLBACK_PROPERTIES from main page, properties listing, and property detail
- Pages now start empty and populate only from API responses
- Show empty state / error on API failure instead of dummy data
- Added getCustomerByUserId and getOwnerByUserId API functions
- Profile page extracts user ID (SID) from JWT, calls appropriate endpoint
- Falls back to JWT/localStorage if API call fails
- Maps API fields (firstName, lastName, whatsAppNumber, phone, etc.) to form
- Added loading.js (dark/light variants) for all 14 routes
- Added error.js (dark/light variants) for all 14 routes
- Added global not-found.js and loading.js at root
- Admin page shows 404 illustration for non-admin users instead of redirecting
- Tenant form: added WhatsApp number + National number inputs
- Owner form: added National number input (already had WhatsApp)
- Both forms send whatsAppNumber and nationalNumber in payload
- Added validation for required fields
- FullName split into FirstName + LastName in both forms and API
- File fields renamed: FrontIdCarImage -> FrontIdCarImagePath, RearIdCarImage -> RearIdCarImagePath
- Added Language field to form data
- getRentProperty now uses /RentProperties/GetRentPropertyById/{id}
- addCustomer/addOwner now use FormData with multipart upload
- Front and back ID images appended as FrontIdCarImage/RearIdCarImage
- Registration pages pass idImages.front and idImages.back to API
- Field names mapped to PascalCase for .NET API (FullName, Email, etc.)
Login page:
- Email/phone tabs with auto-detect from input
- Calls LogInWithEmail or LogInWithPhoneNumber API
- On 206 (Partial Content): shows OTP step, sends OTP, then verifies
- On 200: stores JWT in localStorage, decodes user info
- OTP step with resend button and back navigation
- Console logs throughout all auth flows
API client:
- Added authFetch() for raw status code handling (200/206)
- Added loginWithEmail, loginWithPhone, sendEmailOTP, sendPhoneOTP,
verifyEmail, verifyPhone, isEmail, isPhoneNumber
- apiFetch now accepts 206 as non-error
- api.js: getRentProperties/getSaleProperties now fetch PropertyInformation
for each property's propInfoId (when Properties/Get endpoint is fixed)
- Updated all 3 mapApiProperty functions to handle flat response format
(no nested propertyInformation) - uses defaults for missing fields
- Status/type mapping checks both flat and nested fields
- Created app/utils/api.js with functions for all OpenAPI endpoints
- Updated main page to fetch RentProperties + SaleProperties from API
- Updated properties listing page with API integration
- Updated property detail page to fetch by ID from API
- Added mapApiProperty() adapter to transform API responses to UI format
- All pages gracefully fall back to dummy data if API is unavailable