mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 06:26:03 +08:00
fix: where clause issue (#4023)
This commit is contained in:
parent
d9950d9223
commit
c109636889
@ -117,9 +117,15 @@ export function replaceStringWithMaxLength(
|
||||
array: string[],
|
||||
replacementString: string,
|
||||
): string {
|
||||
const lastSearchValue = array.pop() ?? ''; // Remove the last search value from the array
|
||||
if (lastSearchValue === '') return `${mainString}${replacementString},`; // if user select direclty from options
|
||||
return mainString.replace(lastSearchValue, `${replacementString},`);
|
||||
const lastSearchValue = array.pop() ?? '';
|
||||
if (lastSearchValue === '') {
|
||||
return `${mainString}${replacementString},`;
|
||||
}
|
||||
const updatedString = mainString.replace(
|
||||
new RegExp(`${lastSearchValue}(?=[^${lastSearchValue}]*$)`),
|
||||
replacementString,
|
||||
);
|
||||
return `${updatedString},`;
|
||||
}
|
||||
|
||||
export function checkCommaInValue(str: string): string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user