fix(5): add authorization headers to export API calls
This commit is contained in:
@@ -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}` }
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user