Profile page fetches full data from API via GetByUserId
All checks were successful
Build frontend / build (push) Successful in 39s
All checks were successful
Build frontend / build (push) Successful in 39s
- 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
This commit is contained in:
@ -157,6 +157,18 @@ export async function getTerms() {
|
||||
return apiFetch('/Terms/GetTerms');
|
||||
}
|
||||
|
||||
// ─── Profile ───
|
||||
|
||||
export async function getCustomerByUserId(userId) {
|
||||
console.log('[API] Fetching customer by user ID:', userId);
|
||||
return apiFetch(`/Customer/GetByUserId/${userId}`);
|
||||
}
|
||||
|
||||
export async function getOwnerByUserId(userId) {
|
||||
console.log('[API] Fetching owner by user ID:', userId);
|
||||
return apiFetch(`/Owner/GetByUserId/${userId}`);
|
||||
}
|
||||
|
||||
// ─── Auth: Registration ───
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user