Skip to content

Commit

Permalink
set saved search order
Browse files Browse the repository at this point in the history
Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla committed Oct 23, 2024
1 parent 20cc1a5 commit a886620
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ export const useSearch = (services: DiscoverViewServices) => {
useEffect(() => {
(async () => {
const savedSearchInstance = await getSavedSearchById(savedSearchId);
setSavedSearch(savedSearchInstance);

const query =
savedSearchInstance.searchSource.getField('query') ||
Expand Down Expand Up @@ -393,6 +392,7 @@ export const useSearch = (services: DiscoverViewServices) => {

filterManager.setAppFilters(actualFilters);
data.query.queryString.setQuery(query);
setSavedSearch(savedSearchInstance);

Check warning on line 395 in src/plugins/discover/public/application/view_components/utils/use_search.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/discover/public/application/view_components/utils/use_search.ts#L395

Added line #L395 was not covered by tests

if (savedSearchInstance?.id) {
chrome.recentlyAccessed.add(
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/query_enhancements/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class QueryEnhancementsPlugin
title: 'SQL',
search: sqlSearchInterceptor,
getQueryString: (query: Query) => {
return `SELECT * FROM ${queryString.getQuery().dataset?.title} LIMIT 10`;
return `SELECT * FROM ${query.dataset?.title} LIMIT 10`;
},
fields: {
filterable: false,
Expand Down

0 comments on commit a886620

Please sign in to comment.