diff --git a/frontend/src/lib/components/CommandBar/searchBarLogic.ts b/frontend/src/lib/components/CommandBar/searchBarLogic.ts index ee0625d21d312..d384cea3b098e 100644 --- a/frontend/src/lib/components/CommandBar/searchBarLogic.ts +++ b/frontend/src/lib/components/CommandBar/searchBarLogic.ts @@ -74,17 +74,21 @@ export const searchBarLogic = kea([ actions.reportCommandBarSearch(values.searchQuery.length) + let response if (clickhouseTabs.includes(values.activeTab)) { // prevent race conditions when switching tabs quickly - return values.rawSearchResponse + response = values.rawSearchResponse } else if (values.activeTab === Tab.All) { - return await api.search.list({ q: values.searchQuery }) + response = await api.search.list({ q: values.searchQuery }) } else { - return await api.search.list({ + response = await api.search.list({ q: values.searchQuery, entities: [values.activeTab.toLowerCase() as SearchableEntity], }) } + + breakpoint() + return response }, }, ], @@ -93,7 +97,9 @@ export const searchBarLogic = kea([ { loadPersonsResponse: async (_, breakpoint) => { await breakpoint(DEBOUNCE_MS) - return await api.persons.list({ search: values.searchQuery }) + const response = await api.persons.list({ search: values.searchQuery }) + breakpoint() + return response }, }, ], @@ -102,7 +108,9 @@ export const searchBarLogic = kea([ { loadGroup0Response: async (_, breakpoint) => { await breakpoint(DEBOUNCE_MS) - return await api.groups.list({ group_type_index: 0, search: values.searchQuery }) + const response = await api.groups.list({ group_type_index: 0, search: values.searchQuery }) + breakpoint() + return response }, }, ], @@ -111,7 +119,9 @@ export const searchBarLogic = kea([ { loadGroup1Response: async (_, breakpoint) => { await breakpoint(DEBOUNCE_MS) - return await api.groups.list({ group_type_index: 1, search: values.searchQuery }) + const response = await api.groups.list({ group_type_index: 1, search: values.searchQuery }) + breakpoint() + return response }, }, ], @@ -120,7 +130,9 @@ export const searchBarLogic = kea([ { loadGroup2Response: async (_, breakpoint) => { await breakpoint(DEBOUNCE_MS) - return await api.groups.list({ group_type_index: 2, search: values.searchQuery }) + const response = await api.groups.list({ group_type_index: 2, search: values.searchQuery }) + breakpoint() + return response }, }, ], @@ -129,7 +141,9 @@ export const searchBarLogic = kea([ { loadGroup3Response: async (_, breakpoint) => { await breakpoint(DEBOUNCE_MS) - return await api.groups.list({ group_type_index: 3, search: values.searchQuery }) + const response = await api.groups.list({ group_type_index: 3, search: values.searchQuery }) + breakpoint() + return response }, }, ], @@ -138,7 +152,9 @@ export const searchBarLogic = kea([ { loadGroup4Response: async (_, breakpoint) => { await breakpoint(DEBOUNCE_MS) - return await api.groups.list({ group_type_index: 4, search: values.searchQuery }) + const response = await api.groups.list({ group_type_index: 4, search: values.searchQuery }) + breakpoint() + return response }, }, ],