Fix: Partner-Tab Usersuche nutzt /api/admin/users?q= (bestehende Route), SW by-v550
This commit is contained in:
parent
df104c2c57
commit
62b3138c41
3 changed files with 8 additions and 7 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
Router, State-Management, Navigation, Initialisierung.
|
Router, State-Management, Navigation, Initialisierung.
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const APP_VER = '526'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
const APP_VER = '527'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||||
const APP_VERSION = '1.1.1'; // ← semantische Version, wird bei make release gesetzt
|
const APP_VERSION = '1.1.1'; // ← semantische Version, wird bei make release gesetzt
|
||||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1961,7 +1961,8 @@ window.Page_admin = (() => {
|
||||||
if (q.length < 1) { grantResult.innerHTML = ''; return; }
|
if (q.length < 1) { grantResult.innerHTML = ''; return; }
|
||||||
_searchTimeout = setTimeout(async () => {
|
_searchTimeout = setTimeout(async () => {
|
||||||
try {
|
try {
|
||||||
const users = await API.get(`/api/admin/users/search?q=${encodeURIComponent(q)}`);
|
const res = await API.get(`/api/admin/users?q=${encodeURIComponent(q)}&limit=10`);
|
||||||
|
const users = res?.users || res || [];
|
||||||
if (!users || !users.length) {
|
if (!users || !users.length) {
|
||||||
grantResult.innerHTML = `<p style="font-size:var(--text-xs);color:var(--c-text-muted)">Kein User gefunden.</p>`;
|
grantResult.innerHTML = `<p style="font-size:var(--text-xs);color:var(--c-text-muted)">Kein User gefunden.</p>`;
|
||||||
return;
|
return;
|
||||||
|
|
@ -1972,9 +1973,7 @@ window.Page_admin = (() => {
|
||||||
cursor:pointer;background:var(--c-surface-2);margin-bottom:2px;
|
cursor:pointer;background:var(--c-surface-2);margin-bottom:2px;
|
||||||
font-size:var(--text-sm);display:flex;justify-content:space-between">
|
font-size:var(--text-sm);display:flex;justify-content:space-between">
|
||||||
<span><strong>${u.name}</strong></span>
|
<span><strong>${u.name}</strong></span>
|
||||||
<span style="color:var(--c-text-muted);font-size:var(--text-xs)">
|
<span style="color:var(--c-text-muted);font-size:var(--text-xs)">${u.rolle}</span>
|
||||||
${u.is_founder ? '⭐ Gründer ' : ''}${u.is_partner ? '🤝 Partner' : ''}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
`).join('');
|
`).join('');
|
||||||
grantResult.querySelectorAll('.adm-grant-user').forEach(div => {
|
grantResult.querySelectorAll('.adm-grant-user').forEach(div => {
|
||||||
|
|
@ -1984,7 +1983,9 @@ window.Page_admin = (() => {
|
||||||
grantResult.innerHTML = `<p style="font-size:var(--text-xs);color:var(--c-success,#16a34a)">✓ ${div.dataset.name} ausgewählt</p>`;
|
grantResult.innerHTML = `<p style="font-size:var(--text-xs);color:var(--c-success,#16a34a)">✓ ${div.dataset.name} ausgewählt</p>`;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch { grantResult.innerHTML = ''; }
|
} catch(e) {
|
||||||
|
grantResult.innerHTML = `<p style="font-size:var(--text-xs);color:var(--c-danger)">${e.message || 'Suchfehler'}</p>`;
|
||||||
|
}
|
||||||
}, 400);
|
}, 400);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
Offline-Cache + Push Notifications + Tile-Cache
|
Offline-Cache + Push Notifications + Tile-Cache
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
const CACHE_VERSION = 'by-v549';
|
const CACHE_VERSION = 'by-v550';
|
||||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue