Fix API connectivity and import filament data from PDF

- Update all environment files to use new PostgreSQL API endpoint
- Fix CORS configuration in API server
- Import 35 filaments and 29 colors from PDF data
- Fix TypeScript type error in dashboard
- Add back emoji icons for dark mode toggle
- Remove debugging code and test buttons
- Clean up error handling
This commit is contained in:
DaX
2025-06-20 15:40:40 +02:00
parent 62a4891112
commit 82c476430f
13 changed files with 737 additions and 29 deletions

View File

@@ -23,7 +23,13 @@ api.interceptors.request.use((config) => {
api.interceptors.response.use(
(response) => response,
(error) => {
if (error.response?.status === 401 || error.response?.status === 403) {
// Only redirect to login for protected routes
const protectedPaths = ['/colors', '/filaments'];
const isProtectedRoute = protectedPaths.some(path =>
error.config?.url?.includes(path) && error.config?.method !== 'get'
);
if ((error.response?.status === 401 || error.response?.status === 403) && isProtectedRoute) {
localStorage.removeItem('authToken');
localStorage.removeItem('tokenExpiry');
window.location.href = '/upadaj';