Adm global
This commit is contained in:
@@ -25,14 +25,12 @@ async function request<T>(endpoint: string, options: RequestOptions = {}): Promi
|
||||
if (authState.token) {
|
||||
headers.set('Authorization', `Bearer ${authState.token}`);
|
||||
}
|
||||
if (authState.user?.tenant_id && !headers.has('X-Tenant-ID')) {
|
||||
headers.set('X-Tenant-ID', authState.user.tenant_id);
|
||||
}
|
||||
|
||||
if (!headers.has('Content-Type')) {
|
||||
headers.set('Content-Type', 'application/json');
|
||||
}
|
||||
headers.set('X-App', 'client');
|
||||
const slug = get(authStore)?.user?.tenant_slug || get(authStore)?.user?.tenant_id || '';
|
||||
const slug = get(auth)?.user?.tenant_slug || get(auth)?.user?.tenant_id || '';
|
||||
headers.set('X-Tenant-Slug', slug);
|
||||
|
||||
const response = await fetch(url, {
|
||||
@@ -67,11 +65,9 @@ async function downloadFile(endpoint: string, filename: string): Promise<void> {
|
||||
if (authState.token) {
|
||||
headers.set('Authorization', `Bearer ${authState.token}`);
|
||||
}
|
||||
if (authState.user?.tenant_id) {
|
||||
headers.set('X-Tenant-ID', authState.user.tenant_id);
|
||||
}
|
||||
headers.set('X-App', 'client');
|
||||
const slug = get(authStore)?.user?.tenant_slug || get(authStore)?.user?.tenant_id || '';
|
||||
const slug = get(auth)?.user?.tenant_slug || get(auth)?.user?.tenant_id || '';
|
||||
headers.set('X-Tenant-Slug', slug);
|
||||
|
||||
const response = await fetch(`${API_BASE}${endpoint}`, {
|
||||
|
||||
Reference in New Issue
Block a user