From 7f9d335f19e60a4ce7f1a2693bde54b930730bfc Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Wed, 25 May 2022 13:42:39 -0500 Subject: [PATCH] Add getCategoryKindName helper --- helpers/categories.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/helpers/categories.js b/helpers/categories.js index 0e36064..e81cf56 100644 --- a/helpers/categories.js +++ b/helpers/categories.js @@ -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 } ] ) )