Skip to content

Commit

Permalink
hotfix db function on utils
Browse files Browse the repository at this point in the history
args inside the WHERE clause of the query didn't work anymore
  • Loading branch information
brtheo authored Jun 18, 2024
1 parent 9ef4512 commit cf93e72
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions force-app/main/default/lwc/bolt/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,15 @@ export const soql = async (req, ...args ) => {
if(args[i]) {
const argName = `arg${i}`;
const _curr = curr.toLocaleLowerCase()
if(
(_curr.includes('from') && !_curr.includes('where'))
|| _curr.includes('select')
) {
if(args[i] instanceof Array)
switch(true) {
case _curr.includes('where'):
params[argName] = args[i]
return `${acc}${curr}:${argName}`;
case _curr.includes('select') && args[i] instanceof Array:
return `${acc}${curr}${args[i].join(',')}`;
else return `${acc}${curr}${args[i]}`;
} else {
params[argName] = args[i];
return `${acc}${curr}:${argName}`;
case _curr.includes('from'):
case _curr.includes('select'):
return `${acc}${curr}${args[i]}`;
}
} else if(args.length === 0) return curr
else return `${acc}${curr}`;
Expand Down

0 comments on commit cf93e72

Please sign in to comment.