Skip to content

Commit

Permalink
fix: organization_id
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Nov 29, 2023
1 parent da9eeea commit 6b907e8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ class CoCreateLazyLoader {
// Call this function at the start of your application
createScriptsDirectory();

// TODO: return the value so it can be applied directly to modules
// this.modules[key] = await Config('modules', false, false)

this.modules = await Config('modules', false, false)
if (!this.modules)
return
Expand Down Expand Up @@ -82,7 +79,7 @@ class CoCreateLazyLoader {
if (valideUrl.pathname.startsWith('/webhooks/')) {
let name = req.url.split('/')[2]; // Assuming URL structure is /webhook/name/...
if (this.modules[name]) {
this.executeScriptWithTimeout(name, { req, res, crud: this.crud, organization, valideUrl, organization_id: data.organization })
this.executeScriptWithTimeout(name, { req, res, crud: this.crud, organization, valideUrl, organization_id: organization._id })
} else {
// Handle unknown module or missing webhook method
res.writeHead(404, { 'Content-Type': 'application/json' });
Expand Down

0 comments on commit 6b907e8

Please sign in to comment.