diff --git a/client/components/Omnichannel/Tags.js b/client/components/Omnichannel/Tags.js index 86faf461c0d39..736827496f422 100644 --- a/client/components/Omnichannel/Tags.js +++ b/client/components/Omnichannel/Tags.js @@ -68,7 +68,7 @@ const Tags = ({ tags = [], handler = () => {}, error = '', tagRequired = false } handleTagValue(event.target.value)} flexGrow={1} placeholder={t('Enter_a_tag')} @@ -80,7 +80,7 @@ const Tags = ({ tags = [], handler = () => {}, error = '', tagRequired = false } {tags.map((tag, i) => ( removeTag(tag)} mie='x8'> - {tag} + {tag?.value ? tag.value : tag} ))} diff --git a/ee/client/omnichannel/cannedResponses/CannedResponseEdit.tsx b/ee/client/omnichannel/cannedResponses/CannedResponseEdit.tsx index ec807b4753ef5..991e25ebbc70e 100644 --- a/ee/client/omnichannel/cannedResponses/CannedResponseEdit.tsx +++ b/ee/client/omnichannel/cannedResponses/CannedResponseEdit.tsx @@ -104,12 +104,15 @@ const CannedResponseEdit: FC<{ tags: any; departmentId: { value: string; label: string }; }; + const mappedTags = tags.map((tag: string | { value: string; label: string }) => + typeof tag === 'object' ? tag?.value : tag, + ); await saveCannedResponse({ ...(_id && { _id }), shortcut, text, scope, - ...(tags.length > 0 && { tags }), + ...(mappedTags.length > 0 && { tags: mappedTags }), ...(departmentId && { departmentId: departmentId.value }), }); dispatchToastMessage({ diff --git a/ee/client/omnichannel/components/CannedResponse/modals/CreateCannedResponse/index.tsx b/ee/client/omnichannel/components/CannedResponse/modals/CreateCannedResponse/index.tsx index 4d941f99cfe0a..6a6fadb083bd1 100644 --- a/ee/client/omnichannel/components/CannedResponse/modals/CreateCannedResponse/index.tsx +++ b/ee/client/omnichannel/components/CannedResponse/modals/CreateCannedResponse/index.tsx @@ -87,12 +87,15 @@ const WrapCreateCannedResponseModal: FC<{ data?: any; reloadCannedList?: any }> tags: any; departmentId: { value: string; label: string }; }; + const mappedTags = tags.map((tag: string | { value: string; label: string }) => + typeof tag === 'object' ? tag?.value : tag, + ); await saveCannedResponse({ ...(_id && { _id }), shortcut, text, scope, - ...(tags.length > 0 && { tags }), + ...(tags.length > 0 && { tags: mappedTags }), ...(departmentId && { departmentId: departmentId.value }), }); dispatchToastMessage({