Add getCategoryKindName helper

This commit is contained in:
Sam Carlton 2022-05-25 13:42:39 -05:00
parent 8fcddd72ac
commit 7f9d335f19

View file

@ -201,6 +201,18 @@ export const categories = {
}, },
} }
// Respective directory for each category
export function getCategoryKindName ( categorySlug ) {
if ( categorySlug === 'homebrew' ) {
return 'formula'
}
if ( categorySlug === 'games' ) {
return 'game'
}
return categories[ categorySlug ].slug
}
export const categoriesById = Object.fromEntries( Object.entries( categories ).map( ([ key, category ]) => [category.id, { ...category, key } ] ) ) export const categoriesById = Object.fromEntries( Object.entries( categories ).map( ([ key, category ]) => [category.id, { ...category, key } ] ) )