🎨 ✅ add tests & refactor
- add test for getting all tags - add test for transforming resources - output.json -> mockOutput.json
This commit is contained in:
committed by
Unknown
parent
330612ea4c
commit
8273955316
@@ -7,18 +7,13 @@ import {
|
||||
partiallyIncludesElOf,
|
||||
tagsNotEmpty,
|
||||
cleanString,
|
||||
addCleanTitleAndPath,
|
||||
transformToResources,
|
||||
} from '../utils/pure'
|
||||
|
||||
export const state = () => {
|
||||
const resourcesLens = R.lens(R.prop('resources'), R.assoc('resources'))
|
||||
return {
|
||||
resources: R.map(category =>
|
||||
R.over(resourcesLens, R.map(addCleanTitleAndPath(category.slug)), category),
|
||||
categories),
|
||||
tags: getAllTags(categories),
|
||||
}
|
||||
}
|
||||
export const state = () => ({
|
||||
resources: transformToResources(categories),
|
||||
tags: getAllTags(categories),
|
||||
})
|
||||
|
||||
export const getters = {
|
||||
tags: R.prop('tags'),
|
||||
|
||||
Reference in New Issue
Block a user