From 81288f836dc8e0d9254998049c0e736cebde1e48 Mon Sep 17 00:00:00 2001 From: Cosmin Popovici Date: Tue, 10 Sep 2024 15:36:13 +0300 Subject: [PATCH] fix: config object in beforeCreate event fixes #1344 --- src/server/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index d97a08e7..f3898dea 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -63,7 +63,7 @@ async function renderUpdatedFile(file, config) { // beforeCreate event if (typeof config.beforeCreate === 'function') { - await config.beforeCreate(config) + await config.beforeCreate({ config }) } // Read the file @@ -164,7 +164,7 @@ export default async (config = {}) => { app.get(routePattern, async (req, res, next) => { // Run beforeCreate event if (typeof config.beforeCreate === 'function') { - config.beforeCreate(config) + await config.beforeCreate({ config }) } try { @@ -288,7 +288,7 @@ export default async (config = {}) => { // Run beforeCreate event if (typeof config.beforeCreate === 'function') { - await config.beforeCreate(config) + await config.beforeCreate({ config }) } // Read the file