2023-06-20 00:43:36 +05:30
|
|
|
import { FILTERED_SEARCH_TOKEN_CATEGORY, FILTERED_SEARCH_TOKEN_STATUS } from './constants';
|
2023-05-27 22:25:52 +05:30
|
|
|
|
|
|
|
export const buildFilteredSearchCategoryToken = (categories) => {
|
|
|
|
const options = categories.map((c) => ({ value: c, title: c }));
|
|
|
|
return { ...FILTERED_SEARCH_TOKEN_CATEGORY, options };
|
|
|
|
};
|
2023-06-20 00:43:36 +05:30
|
|
|
|
|
|
|
export const isValidStatus = (status) =>
|
|
|
|
FILTERED_SEARCH_TOKEN_STATUS.options.map((o) => o.value).includes(status);
|