feat(site): implement dynamic site selection dropdown in sidebar and enable multi-site monitoring

This commit is contained in:
Rafif-Riqullah-Siregar committed 2026-07-13 16:57:45 +07:00
1 parent be6bc14190
commit 4882108068
125 files changed
+5666 -4305

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ const bcrypt = require('bcryptjs');
const path = require('path');
const fs = require('fs');
const User = require('../../models/User');
const { requireAuth, makeToken, setCookieToken, upload } = require('./helpers');
const { requireAuth, makeToken, setCookieToken, upload, getUploadsDir } = require('./helpers');
const router = express.Router();
@@ -128,7 +128,7 @@ router.post('/remove-profile-picture', requireAuth, async (req, res) => {
if (!user) return res.status(404).json({ error: 'User not found' });
if (user.profile_picture) {
const filePath = path.join(__dirname, '..', '..', 'uploads', user.profile_picture);
const filePath = path.join(getUploadsDir(), user.profile_picture);
if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
}