expanded log activity

This commit is contained in:
tom.hempel
2026-06-01 22:46:48 +02:00
parent da394c5525
commit e5ac069dc4
6 changed files with 62 additions and 41 deletions

View File

@ -92,3 +92,11 @@ export function apiDownloadUrl(endpoint) {
const cleanEndpoint = endpoint.replace(/\.php(\?|$)/, '$1');
return `${API_BASE}/${cleanEndpoint}${cleanEndpoint.includes('?') ? '&' : '?'}token=${encodeURIComponent(token)}`;
}
/** Authenticated file/download fetch (marks request as website for activity logging). */
export async function apiDownloadFetch(url, options = {}) {
const token = getToken();
const headers = { ...(options.headers || {}), 'X-QDB-Client': 'web' };
if (token) headers['Authorization'] = `Bearer ${token}`;
return fetch(url, { ...options, headers });
}