Make app endpoints a generated value

This commit is contained in:
Sam Carlton 2020-12-11 14:04:03 -06:00
parent ea17b014af
commit 63c405943e
7 changed files with 56 additions and 20 deletions

11
helpers/app-derived.js Normal file
View file

@ -0,0 +1,11 @@
// App Data that is derived from other app data
export function getAppEndpoint ( app ) {
// console.log('app', app)
if (app.category.slug === 'homebrew') return `/formula/${app.slug}`
if (app.category.slug === 'games') return `/game/${app.slug}`
return `/app/${app.slug}`
}