From fe4ca2133d006ff7a64b103ae4de009313dee335 Mon Sep 17 00:00:00 2001 From: Marie <51697796+ijreilly@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:57:34 +0200 Subject: [PATCH] Fix search on email (#7094) following email (text field type) -> emails (emails field type - composite) migration! closes https://github.com/twentyhq/twenty/issues/7080 --- .../src/modules/command-menu/components/CommandMenu.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx b/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx index 9cccd950e..2b7d13f8c 100644 --- a/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx +++ b/packages/twenty-front/src/modules/command-menu/components/CommandMenu.tsx @@ -174,7 +174,11 @@ export const CommandMenu = () => { 'firstName', 'lastName', ]), - { email: { ilike: `%${commandMenuSearch}%` } }, + ...generateILikeFiltersForCompositeFields( + commandMenuSearch, + 'emails', + ['primaryEmail'], + ), { phone: { ilike: `%${commandMenuSearch}%` } }, ]) : undefined,