fix(export): use axiosInstance to ensure correct backend URL and auth

- Changed useExport.ts to import and use axiosInstance from api.ts
- This ensures requests go to port 8918 (backend) not 8919 (frontend)
- Removed manual token handling (axiosInstance interceptor handles it)
- Removed /api prefix from paths (axiosInstance baseURL has the full URL)
- Exported axiosInstance from api.ts for reuse in other modules
- Fixes 404 errors caused by requests routing to frontend instead of backend
This commit is contained in:
2026-04-23 11:04:11 +03:00
parent 1ed2cb6c07
commit dc6970700b
2 changed files with 8 additions and 12 deletions

View File

@@ -57,7 +57,7 @@ export const buildPhotoUrl = (backendUrl: string, photoPath: string): string =>
* [C-01] Axios instance cu JWT Bearer token în header
* și interceptor pentru 401 Unauthorized (token expired)
*/
const axiosInstance = axios.create({});
export const axiosInstance = axios.create({});
axiosInstance.interceptors.request.use(async (config) => {
if (!config.baseURL) {