Skip to content

Commit c679536

Browse files
refactor: make EventKeyWords handleClick's type parameter maintainable
refs LIIKUNTA-455
1 parent de866e7 commit c679536

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

apps/events-helsinki/src/domain/event/eventKeywords/EventKeywords.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ const EventKeywords: React.FC<Props> = ({
3939
locale
4040
);
4141

42-
const handleClick = (type: 'dateType' | 'isFree' | 'text', value = '') =>
43-
getKeywordOnClickHandler(router, locale, type, value);
42+
const handleClick = (
43+
type: Parameters<typeof getKeywordOnClickHandler>[2],
44+
value = ''
45+
) => getKeywordOnClickHandler(router, locale, type, value);
4446

4547
const showComponent =
4648
today ||

apps/hobbies-helsinki/src/domain/event/eventKeywords/EventKeywords.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ const EventKeywords: React.FC<Props> = ({
3939
locale
4040
);
4141

42-
const handleClick = (type: 'dateType' | 'isFree' | 'text', value = '') =>
43-
getKeywordOnClickHandler(router, locale, type, value);
42+
const handleClick = (
43+
type: Parameters<typeof getKeywordOnClickHandler>[2],
44+
value = ''
45+
) => getKeywordOnClickHandler(router, locale, type, value);
4446

4547
const showComponent =
4648
today ||

apps/sports-helsinki/src/domain/event/eventKeywords/EventKeywords.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ const EventKeywords: React.FC<Props> = ({
3939
locale
4040
);
4141

42-
const handleClick = (type: 'dateType' | 'isFree' | 'text', value = '') =>
43-
getKeywordOnClickHandler(router, locale, type, value);
42+
const handleClick = (
43+
type: Parameters<typeof getKeywordOnClickHandler>[2],
44+
value = ''
45+
) => getKeywordOnClickHandler(router, locale, type, value);
4446

4547
const showComponent =
4648
today ||

0 commit comments

Comments
 (0)