@empathyco/x-components
Version:
Empathy X Components
21 lines (19 loc) • 638 B
JavaScript
const fetchAndSaveNextQueryPreview = async ({ dispatch, commit }, { query, location }) => {
return dispatch('fetchNextQueryPreview', { query, location })
.then(response => {
if (response) {
commit('setResultsPreview', {
[query]: {
query,
totalResults: response.totalResults,
items: response.results,
},
});
}
})
.catch(error => {
console.error(error);
});
};
export { fetchAndSaveNextQueryPreview };
//# sourceMappingURL=fetch-and-save-next-query-preview.action.js.map