diff --git a/public/js/admin.js b/public/js/admin.js index 4a70e18..84c096f 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -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) } } diff --git a/public/js/api.js b/public/js/api.js index fd48ad4..a201176 100644 --- a/public/js/api.js +++ b/public/js/api.js @@ -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();