@empathyco/x-components
Version:
Empathy X Components
25 lines (22 loc) • 733 B
JavaScript
import { XPlugin } from '../../../../plugins/x-plugin.js';
/**
* Default implementation for the {@link QueriesPreviewActions.fetchQueryPreview}.
*
* @param _context - The {@link https://vuex.vuejs.org/guide/actions.html | context} of the actions,
* provided by Vuex.
* @param request - The query preview request to make.
* @returns A Promise of a SearchResponse when it fetches the results.
*
* @public
*/
const fetchQueryPreview = async (_context, request) => {
const { query } = request;
if (!query) {
return null;
}
return XPlugin.adapter.search(request, {
id: `fetchQueryPreview-${query}`,
});
};
export { fetchQueryPreview };
//# sourceMappingURL=fetch-query-preview.action.js.map