only include checked checkbox fields in prechat form submission

This commit is contained in:
Abhinav Raut
2026-07-22 01:31:37 +05:30
parent 83f9bb5828
commit cf629f34d7
@@ -314,7 +314,7 @@ const submitForm = handleSubmit((values) => {
const field = sortedFields.value.find((f) => f.key === key)
const value = values[key]
if (
field?.type === 'checkbox' ||
(field?.type === 'checkbox' && value === true) ||
(value !== undefined && value !== null && String(value).trim() !== '')
) {
filteredValues[key] = value