fix(routes): complete post-refactor dependency wiring cleanup

This commit is contained in:
Krystie
2026-05-02 20:43:39 -07:00
parent 4eebb3ce7a
commit 0c658a26a8
32 changed files with 495 additions and 396 deletions

View File

@@ -22,9 +22,9 @@ try {
// Image processing libraries not available — favicon conversion disabled
}
module.exports = function(ctx) {
const { servicesStateManager, asyncHandler, log } = ctx;
module.exports = function({ servicesStateManager: _servicesStateManager, asyncHandler, log: _log, CONFIG_FILE, readConfig, saveConfig, errorResponse }) {
const router = express.Router();
const ctx = { CONFIG_FILE, readConfig, saveConfig, errorResponse };
// ===== ASSET UPLOAD =====
@@ -47,7 +47,6 @@ module.exports = function(ctx) {
throw new ValidationError('Invalid image data format');
}
const extension = matches[1] === 'svg+xml' ? 'svg' : matches[1];
const base64Data = matches[2];
const buffer = Buffer.from(base64Data, 'base64');
@@ -109,6 +108,7 @@ module.exports = function(ctx) {
// Upload custom logo(s) and/or update position and title
// Supports: dataDark/dataLight (separate variants) or data (single logo for both)
// eslint-disable-next-line complexity
router.post('/logo', express.json({ limit: LIMITS.BODY_UPLOAD }), asyncHandler(async (req, res) => {
const { data, dataDark, dataLight, position, dashboardTitle } = req.body;
@@ -231,7 +231,6 @@ module.exports = function(ctx) {
throw new ValidationError('Invalid image data format');
}
const imageType = matches[1];
const base64Data = matches[2];
const buffer = Buffer.from(base64Data, 'base64');