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:
@@ -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) }
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user