Revert "sad"

This reverts commit 550a8f26a2.
This commit is contained in:
alorig
2025-11-30 06:14:54 +05:00
parent 550a8f26a2
commit 8d47d6a555
5 changed files with 31 additions and 142 deletions

View File

@@ -155,29 +155,8 @@ export const importTableData = async (
const queryString = params.toString();
const url = `${API_BASE_URL}${endpoint}${queryString ? `?${queryString}` : ''}`;
// Get authentication token (consistent with other API calls)
const getAuthToken = () => {
try {
const authStorage = localStorage.getItem('auth-storage');
if (authStorage) {
const parsed = JSON.parse(authStorage);
return parsed?.state?.token || null;
}
} catch (e) {
// Ignore parsing errors
}
return null;
};
const token = getAuthToken();
const headers: HeadersInit = {};
if (token) {
headers['Authorization'] = `Bearer ${token}`;
}
const response = await fetch(url, {
method: 'POST',
headers,
body: formData,
credentials: 'include',
});