Skip to content

Commit 57b31b2

Browse files
committed
chore: fix syntax of api handlers for better static analysis
1 parent fbfd0cc commit 57b31b2

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

plugin/src/templates/getApiHandler.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ export const getApiHandler = ({ page, schedule, publishDir = '../../../.next', a
126126
let staticManifest
127127
const path = require("path");
128128
const pageRoot = path.resolve(path.join(__dirname, "${publishDir}", "serverless", "pages"));
129-
exports.handler = ${
130-
schedule
131-
? `schedule(${JSON.stringify(
132-
schedule,
133-
)},(${makeHandler.toString()})(config, "${appDir}", pageRoot, ${JSON.stringify(page)}));`
134-
: `(${makeHandler.toString()})(config, "${appDir}", pageRoot, ${JSON.stringify(page)});`
135-
}
129+
const handler = (${makeHandler.toString()})(config, "${appDir}", pageRoot, ${JSON.stringify(page)})
130+
exports.handler = ${schedule ? `schedule(${JSON.stringify(schedule)}, handler);` : 'handler'}
136131
`

0 commit comments

Comments
 (0)