fix(client): use getAdminProperties in admin panel

- Add getAdminProperties() to api.js with admin endpoint
- Update admin.js loadProperties() to use getAdminProperties
- Returns full dataset with admin filtering support

Refs: production admin panel
This commit is contained in:
APAW Agent Sync
2026-05-14 09:26:22 +01:00
parent 6fe3687ad3
commit 08e2d21f7d
2 changed files with 7 additions and 1 deletions

View File

@@ -207,7 +207,7 @@ class AdminPanel {
// ============ PROPERTIES ============
async loadProperties() {
try {
const res = await API.getProperties({ lang: this.lang, limit: 100 })
const res = await API.getAdminProperties({ status: 'active', limit: 100 })
if (res.success) { this.properties = res.data; this.renderPropertiesGrid() }
} catch (e) { console.error('Failed to load properties:', e) }
}

View File

@@ -261,6 +261,12 @@ class API {
return response.json();
}
static async getAdminProperties(filters = {}) {
const params = new URLSearchParams(filters).toString();
const response = await fetch(`${API_BASE}/admin/properties${params ? '?' + params : ''}`, { credentials: 'include' });
return response.json();
}
static async getAdminStats() {
const response = await fetch(`${API_BASE}/admin/stats`, { credentials: 'include' });
return response.json();