Skip to content

Commit

Permalink
fix: $param handeling
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 4, 2024
1 parent 61181ad commit 4f1cafc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class CoCreateLazyLoader {
const valideUrl = new URL(`http://${req.headers.host}${req.url}`);
const hostname = valideUrl.hostname;
let organization

try {
organization = await this.crud.getOrganization({ host: hostname });
} catch {
Expand Down Expand Up @@ -173,11 +174,11 @@ class CoCreateLazyLoader {

let params = [], mainParam = false
for (let i = 0; true; i++) {
if (`$param[${i}]` in object) {
params.push(data[`$param[${i}]`])
delete data[`$param[${i}]`]
if (`$param[${i}]` in data[name]) {
params.push(data[name][`$param[${i}]`])
delete data[name][`$param[${i}]`]
} else if (!mainParam) {
params.push([data[name]])
params.push(data[name])
mainParam = true
} else {
break;
Expand Down

0 comments on commit 4f1cafc

Please sign in to comment.