Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/components/Omnichannel/Tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const Tags = ({ tags = [], handler = () => {}, error = '', tagRequired = false }
<Field.Row>
<TextInput
error={error}
value={tagValue}
value={tagValue?.value ? tagValue.value : tagValue}
onChange={(event) => handleTagValue(event.target.value)}
flexGrow={1}
placeholder={t('Enter_a_tag')}
Expand All @@ -80,7 +80,7 @@ const Tags = ({ tags = [], handler = () => {}, error = '', tagRequired = false }
<Field.Row justifyContent='flex-start'>
{tags.map((tag, i) => (
<Chip key={i} onClick={() => removeTag(tag)} mie='x8'>
{tag}
{tag?.value ? tag.value : tag}
</Chip>
))}
</Field.Row>
Expand Down
5 changes: 4 additions & 1 deletion ee/client/omnichannel/cannedResponses/CannedResponseEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down