🔥 (viewer) Remove buttons input validation
Did not work with buttons that contain a variable
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
export * from './utils'
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from './validateButtonInput'
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import { ChoiceInputBlock } from 'models'
|
|
||||||
|
|
||||||
export const validateButtonInput = (
|
|
||||||
buttonBlock: ChoiceInputBlock,
|
|
||||||
input: string
|
|
||||||
) =>
|
|
||||||
buttonBlock.items.some(
|
|
||||||
(item) =>
|
|
||||||
item.content === input ||
|
|
||||||
(item.content?.startsWith('{{') && item.content.endsWith('}}'))
|
|
||||||
)
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import { validateButtonInput } from '@/features/blocks/inputs/buttons/api'
|
|
||||||
import { validateEmail } from '@/features/blocks/inputs/email/api'
|
import { validateEmail } from '@/features/blocks/inputs/email/api'
|
||||||
import {
|
import {
|
||||||
formatPhoneNumber,
|
formatPhoneNumber,
|
||||||
@@ -231,10 +230,6 @@ export const isReplyValid = (inputValue: string, block: Block): boolean => {
|
|||||||
return validatePhoneNumber(inputValue)
|
return validatePhoneNumber(inputValue)
|
||||||
case InputBlockType.URL:
|
case InputBlockType.URL:
|
||||||
return validateUrl(inputValue)
|
return validateUrl(inputValue)
|
||||||
case InputBlockType.CHOICE:
|
|
||||||
if (block.options.isMultipleChoice || block.options.dynamicVariableId)
|
|
||||||
return true
|
|
||||||
return validateButtonInput(block, inputValue)
|
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user