Fix upload directory path issue
- Change UPLOAD_DIR from ../uploads to ./uploads in server/.env - Use absolute path with process.cwd() in upload middleware - Ensures uploads directory is created in correct location
This commit is contained in:
@@ -145,7 +145,7 @@
|
||||
|
||||
## Cleanup Tracking System
|
||||
|
||||
- [-] 18. Implement "Mark as Cleaned" functionality
|
||||
- [x] 18. Implement "Mark as Cleaned" functionality
|
||||
- Add `cleaned_at` timestamp field to reports table
|
||||
- Add `cleaned_by_user_id` field to track who marked it as cleaned
|
||||
- Create POST /api/reports/:id/mark-cleaned backend endpoint
|
||||
|
||||
@@ -2,8 +2,8 @@ import multer from 'multer';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
|
||||
// Ensure upload directory exists
|
||||
const uploadDir = process.env.UPLOAD_DIR || './uploads';
|
||||
// Ensure upload directory exists - use absolute path
|
||||
const uploadDir = process.env.UPLOAD_DIR || path.join(process.cwd(), 'uploads');
|
||||
if (!fs.existsSync(uploadDir)) {
|
||||
fs.mkdirSync(uploadDir, { recursive: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user