Skip to content

Commit

Permalink
feat(queries-preview): display tagging from QP request accessible in …
Browse files Browse the repository at this point in the history
…QP component (#1389)
  • Loading branch information
CachedaCodes authored Jan 15, 2024
1 parent e524962 commit 27dfec8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:queryPreviewInfo="queryPreviewInfo"
:results="queryPreviewResults.results"
:totalResults="queryPreviewResults.totalResults"
:displayTagging="queryPreviewResults.displayTagging"
>
<ul data-test="query-preview" class="x-query-preview">
<li
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ describe('testing queries preview module actions', () => {
},
query: 'tshirt',
rows: 3
},
displayTagging: {
params: {
follow: false,
lang: 'es',
q: 'lego',
totalHits: '789'
},
url: 'https://api.empathybroker.com/tagging/v1/track/query'
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const fetchAndSaveQueryPreview: QueriesPreviewXStoreModule['actions']['fe
request,
results: response?.results ?? [],
status: 'success',
displayTagging: response?.displayTagging ?? undefined,
totalResults: response?.totalResults ?? 0
});
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Result, SearchRequest, SearchResponse } from '@empathyco/x-types';
import { Result, SearchRequest, SearchResponse, TaggingRequest } from '@empathyco/x-types';
import { Dictionary } from '@empathyco/x-utils';
import { XActionContext } from '../../../store/actions.types';
import { XStoreModule } from '../../../store/store.types';
Expand All @@ -21,6 +21,8 @@ export interface QueryPreviewItem extends StatusState {
request: SearchRequest;
/** Results of the query preview request. */
results: Result[];
/** Display tagging info */
displayTagging?: TaggingRequest;
/** The total number of results for the search query. */
totalResults: number;
}
Expand Down

0 comments on commit 27dfec8

Please sign in to comment.