Spaces in titles are replaced by hyphen for category title matching to support spaces in titles.

This commit is contained in:
KenavR
2020-10-29 19:37:38 +01:00
parent 75c49a0787
commit 77cec39c4b

View File

@@ -21,7 +21,7 @@ export const getters = {
findCategory: state => categoryTitle => {
// equalsCategoryTitle :: Category -> Bool
const equalsCategoryTitle = R.compose(
R.equals(cleanString(categoryTitle)), cleanString, R.prop('title'),
R.equals(cleanString(categoryTitle)), R.replace(/ /g, '-') ,cleanString, R.prop('title'),
)
// findCategory :: [Category] -> Category
const findCategory = R.find(equalsCategoryTitle)