Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion ee/app/api-enterprise/server/lib/canned-responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export async function findAllCannedResponsesFilter({ userId, shortcut, text, dep
...shortcut ? [{ shortcut }] : [],
...text ? [{ $or: [{ shortcut: textFilter }, { text: textFilter }] }] : [],
...scope ? [{ scope }] : [],
...createdBy ? [{ 'createdBy.username': createdBy }] : [],
...createdBy ? [{ 'createdBy._id': createdBy }] : [],
...tags.length ? [{
tags: {
$in: tags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import AutoCompleteTagsMultiple from '../tags/AutoCompleteTagsMultiple';

type CannedResponsesFilterProps = {
sharingValue: string;
createdByValue: { value: string; label: string };
tagsValue: string;
createdByValue: string;
tagsValue: Array<{ value: string; label: string }>;
shortcutValue: string;
setSharing: (eventOrValue: unknown) => void;
setCreatedBy: (eventOrValue: unknown) => void;
Expand Down
10 changes: 5 additions & 5 deletions ee/client/omnichannel/cannedResponses/CannedResponsesRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ const CannedResponsesRoute: FC = () => {

type CannedResponseFilterValues = {
sharing: string;
createdBy: { value: string; label: string };
tags: string;
createdBy: string;
tags: Array<{ value: string; label: string }>;
text: string;
firstMessage: string;
};

const { values, handlers } = useForm({
sharing: '',
createdBy: {},
createdBy: '',
tags: [],
text: '',
});
Expand All @@ -52,9 +52,9 @@ const CannedResponsesRoute: FC = () => {
() => ({
text: debouncedText,
sort: JSON.stringify({ [debouncedSort[0]]: debouncedSort[1] === 'asc' ? 1 : -1 }),
...(tags && tags.length > 0 && { tags }),
...(tags && tags.length > 0 && { tags: tags.map((tag) => tag.label) }),
...(sharing && { scope: sharing }),
...(createdBy?.label && { createdBy: createdBy.label }),
...(createdBy && createdBy !== 'all' && { createdBy }),
...(debouncedParams.itemsPerPage && { count: debouncedParams.itemsPerPage }),
...(debouncedParams.current && { offset: debouncedParams.current }),
}),
Expand Down