Fix DC-005 depth-2 route path bugs: 67 broken requires across 21 files
The DC-005 src/ refactor left depth-2 route files (routes/auth/*, routes/recipes/*, routes/apps/*, routes/arr/*, routes/config/*) with broken require() paths. A filesystem-resolving scanner found 67 broken requires across 21 files — three distinct bug classes: A) '../../../src/...' (3 levels up, above package root) — Bug 7, ~49 occurrences B) '../src/utils/...' (1 level up, resolves to nonexistent routes/src/) — ~15 occurrences C) routes/apps/restore.js:5 used utilities/responses (wrong dir) — should be utils/responses All fixed to '../../src/...' (or '../../src/utils/responses' for class C). routes/auth/totp.js was already fixed in the DC-006 commit. Post-fix: 922/922 tests pass, zero new ESLint warnings. No logic changes — purely mechanical require() path corrections.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const express = require('express');
|
||||
const { exists } = require('../../../src/utilities/fs-helpers');
|
||||
const { exists } = require('../../src/utilities/fs-helpers');
|
||||
/**
|
||||
* Apps templates routes factory
|
||||
* @param {Object} deps - Explicit dependencies
|
||||
@@ -19,8 +19,8 @@ const { exists } = require('../../../src/utilities/fs-helpers');
|
||||
* @param {string} deps.SERVICES_FILE - Services file path
|
||||
* @returns {express.Router}
|
||||
*/
|
||||
const { REGEX } = require('../../../src/utilities/constants');
|
||||
const { ok } = require('../src/utils/responses');
|
||||
const { REGEX } = require('../../src/utilities/constants');
|
||||
const { ok } = require('../../src/utils/responses');
|
||||
|
||||
module.exports = function({
|
||||
servicesStateManager, asyncHandler, helpers,
|
||||
@@ -55,7 +55,7 @@ module.exports = function({
|
||||
const { appId } = req.params;
|
||||
const template = ctx.APP_TEMPLATES[appId];
|
||||
if (!template) {
|
||||
const { NotFoundError } = require('../../../src/utilities/errors');
|
||||
const { NotFoundError } = require('../../src/utilities/errors');
|
||||
throw new NotFoundError('App template');
|
||||
}
|
||||
ok(res, { template });
|
||||
@@ -90,7 +90,7 @@ module.exports = function({
|
||||
// Update subdomain for deployed app
|
||||
router.post('/update-subdomain', asyncHandler(async (req, res) => {
|
||||
const { serviceId, oldSubdomain, newSubdomain, containerId, ip } = req.body;
|
||||
const { ValidationError } = require('../../../src/utilities/errors');
|
||||
const { ValidationError } = require('../../src/utilities/errors');
|
||||
|
||||
if (!oldSubdomain || typeof oldSubdomain !== 'string') {
|
||||
throw new ValidationError('oldSubdomain is required');
|
||||
|
||||
Reference in New Issue
Block a user