fix(routes): complete post-refactor dependency wiring cleanup
This commit is contained in:
@@ -27,17 +27,21 @@ module.exports = function(ctx) {
|
||||
log: ctx.log,
|
||||
// Additional context properties needed by routes
|
||||
APP_TEMPLATES: ctx.APP_TEMPLATES,
|
||||
TEMPLATE_CATEGORIES: ctx.TEMPLATE_CATEGORIES,
|
||||
DIFFICULTY_LEVELS: ctx.DIFFICULTY_LEVELS,
|
||||
siteConfig: ctx.siteConfig,
|
||||
buildDomain: ctx.buildDomain,
|
||||
buildServiceUrl: ctx.buildServiceUrl,
|
||||
addServiceToConfig: ctx.addServiceToConfig,
|
||||
dns: ctx.dns,
|
||||
notification: ctx.notification,
|
||||
safeErrorMessage: ctx.safeErrorMessage
|
||||
safeErrorMessage: ctx.safeErrorMessage,
|
||||
SERVICES_FILE: ctx.SERVICES_FILE,
|
||||
ctx: ctx
|
||||
};
|
||||
|
||||
// Initialize helpers with dependencies
|
||||
const helpers = initHelpers(ctx);
|
||||
// Initialize helpers with dependencies (ctx is the Koa context)
|
||||
const helpers = initHelpers({ ...deps, ctx });
|
||||
|
||||
// Mount sub-routes — pass full ctx so sub-routes can reference ctx.* properties
|
||||
const subCtx = Object.assign({}, ctx, { helpers });
|
||||
|
||||
Reference in New Issue
Block a user