alpinesmuseum-public/assets/js/redux/actions/catalog.js
2022-09-23 07:38:37 +05:30

33 lines
829 B
JavaScript

export const GET_CATALOG = '[catalog] GET';
export const FETCH_CATALOG_SUCCESS = '[catalog] Fetch success';
export const FETCH_CATALOG_ERROR = '[catalog] Fetch error';
export const UPDATE_CATALOG = '[catalog] Update';
export const SEARCH_CATALOG = '[catalog] Search for items';
export const SEARCH_CATALOG_SUCCESS = '[catalog] Search success';
export const FILTER_CATALOG = '[catalog] Filter items by tags';
export const FILTER_CATALOG_SUCCESS = '[catalog] Filter success';
export const getCatalog = (clear = false) => ({
type: GET_CATALOG,
payload: clear
});
export const updateCatalog = data => ({
type: UPDATE_CATALOG,
payload: data
});
export const search = query => {
return {
type: SEARCH_CATALOG,
payload: query
};
};
export const filter = tags => {
return {
type: FILTER_CATALOG,
payload: tags
};
};