Skip to content

Commit 0e45814

Browse files
authored
chore(omnichannel): remove 'any' usage by applying required Type safety (#38982)
1 parent 813d57a commit 0e45814

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

apps/meteor/client/views/omnichannel/additionalForms/CurrentChatTags.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { useHasLicenseModule } from '../../../hooks/useHasLicenseModule';
44
import AutoCompleteTagsMultiple from '../tags/AutoCompleteTagsMultiple';
55

66
type CurrentChatTagsProps = Pick<ComponentProps<typeof AutoCompleteTagsMultiple>, 'id' | 'aria-labelledby'> & {
7-
value: Array<{ value: string; label: string }>;
8-
handler: (value: { label: string; value: string }[]) => void;
7+
value: NonNullable<ComponentProps<typeof AutoCompleteTagsMultiple>['value']>;
8+
handler: NonNullable<ComponentProps<typeof AutoCompleteTagsMultiple>['onChange']>;
99
department?: string;
1010
viewAll?: boolean;
1111
};
@@ -17,15 +17,7 @@ const CurrentChatTags = ({ value, handler, department, viewAll, ...props }: Curr
1717
return null;
1818
}
1919

20-
return (
21-
<AutoCompleteTagsMultiple
22-
{...props}
23-
onChange={handler as any} // FIXME: any
24-
value={value}
25-
department={department}
26-
viewAll={viewAll}
27-
/>
28-
);
20+
return <AutoCompleteTagsMultiple {...props} onChange={handler} value={value} department={department} viewAll={viewAll} />;
2921
};
3022

3123
export default CurrentChatTags;

apps/meteor/client/views/omnichannel/components/Tags.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps)
7676
<CurrentChatTags
7777
id={tagsFieldId}
7878
value={paginatedTagValue}
79-
handler={(tags: { label: string; value: string }[]): void => {
79+
handler={(tags): void => {
8080
handler(tags.map((tag) => tag.label));
8181
}}
8282
department={department}

0 commit comments

Comments
 (0)