mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 08:45:52 +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[],
|
array: string[],
|
||||||
replacementString: string,
|
replacementString: string,
|
||||||
): string {
|
): string {
|
||||||
const lastSearchValue = array.pop() ?? ''; // Remove the last search value from the array
|
const lastSearchValue = array.pop() ?? '';
|
||||||
if (lastSearchValue === '') return `${mainString}${replacementString},`; // if user select direclty from options
|
if (lastSearchValue === '') {
|
||||||
return mainString.replace(lastSearchValue, `${replacementString},`);
|
return `${mainString}${replacementString},`;
|
||||||
|
}
|
||||||
|
const updatedString = mainString.replace(
|
||||||
|
new RegExp(`${lastSearchValue}(?=[^${lastSearchValue}]*$)`),
|
||||||
|
replacementString,
|
||||||
|
);
|
||||||
|
return `${updatedString},`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function checkCommaInValue(str: string): string {
|
export function checkCommaInValue(str: string): string {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user