fix(5): add authorization headers to export API calls

This commit is contained in:
2026-04-22 18:04:36 +03:00
parent 62475ae0af
commit 7bb92d3bd9

View File

@@ -49,11 +49,13 @@ export function useExport(): UseExportReturn {
setError(null);
try {
const token = localStorage.getItem('auth_token');
const response = await axios.post(
`/api/admin/exports/inventory-snapshot?format=${format}`,
{},
{
responseType: "blob",
headers: { 'Authorization': `Bearer ${token}` }
}
);
@@ -83,11 +85,13 @@ export function useExport(): UseExportReturn {
setError(null);
try {
const token = localStorage.getItem('auth_token');
const response = await axios.post(
`/api/admin/exports/audit-trail?format=${format}`,
{},
{
responseType: "blob",
headers: { 'Authorization': `Bearer ${token}` }
}
);