fix: [SIG-570]: handle case where - being present in the key (#4735)

This commit is contained in:
Vikrant Gupta 2024-03-22 13:40:43 +05:30 committed by GitHub
parent 9e557a0ebe
commit f34a49e19c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,7 +74,11 @@ export const useTag = (
const handleAddTag = useCallback(
(value: string): void => {
const { tagKey } = getTagToken(value);
const [key, id] = tagKey.split('-');
const parts = tagKey.split('-');
// this is done to ensure that `hello-world` also gets converted to `body CONTAINS hello-world`
const id = parts[parts.length - 1];
const key = parts.slice(0, -1).join('-');
if (id === 'custom') {
const customValue = whereClauseConfig