Skip to content

Commit

Permalink
fix: config object in beforeCreate event
Browse files Browse the repository at this point in the history
fixes #1344
  • Loading branch information
cossssmin committed Sep 10, 2024
1 parent 42a8e3b commit 81288f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 81288f8

Please sign in to comment.