Skip to content

Commit 15ffb7c

Browse files
committed
fix: handle data.crud object
1 parent 00996f5 commit 15ffb7c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class CoCreateLazyLoader {
7979
if (valideUrl.pathname.startsWith('/webhooks/')) {
8080
let name = req.url.split('/')[2]; // Assuming URL structure is /webhook/name/...
8181
if (this.modules[name]) {
82-
this.executeScriptWithTimeout(name, { req, res, crud: this.crud, organization, valideUrl, organization_id: organization._id })
82+
this.executeScriptWithTimeout(name, { req, res, organization, valideUrl, organization_id: organization._id })
8383
} else {
8484
// Handle unknown module or missing webhook method
8585
res.writeHead(404, { 'Content-Type': 'application/json' });
@@ -118,8 +118,10 @@ class CoCreateLazyLoader {
118118

119119
if (this.modules[name].content) {
120120
data.apis = await this.getApiKey(data.organization_id, name)
121+
data.crud = this.crud
121122
data = await this.modules[name].content.send(data)
122123
delete data.apis
124+
delete data.crud
123125
if (data.socket)
124126
this.wsManager.send(data)
125127
} else

0 commit comments

Comments
 (0)