mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
fixes: if references includes includes a template literal (#10464)
This commit is contained in:
parent
f5d8424173
commit
f014a52d99
1 changed files with 10 additions and 3 deletions
|
|
@ -225,10 +225,17 @@ const queryHasStringOtherThanVariable = (query) => {
|
|||
const endsWithDoubleCurly = query.endsWith('}}');
|
||||
|
||||
if (startsWithDoubleCurly && endsWithDoubleCurly) {
|
||||
// Extract the content within the curly braces
|
||||
const content = query.slice(2, -2).trim();
|
||||
// Check if there is a space within the content
|
||||
return content.includes(' ');
|
||||
|
||||
if (content.includes(' ')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//* Check if the content includes a template literal
|
||||
//!Note: Do not delete this regex, it is used to check if the content includes a template literal
|
||||
//used for cases like {{queries.runjs1.data[0][`${components.textinput1.value}`]}}
|
||||
const templateLiteralRegex = /\$\{[^}]+\}/;
|
||||
return templateLiteralRegex.test(content);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue