Simplify code

This commit is contained in:
2023-09-03 23:52:20 +02:00
parent f382f96fee
commit a0e4b53b17
3 changed files with 28 additions and 13 deletions

View File

@@ -23,14 +23,9 @@ export async function useTalents() {
data: getCategories,
} = await $trpc.talents.getCategories.useQuery()
function getCategoryById(id: number) {
return getCategories.value?.find(category => category.id === id)?.name || 'Not Found'
}
return {
talents,
getCategories,
getCategoryById,
isFavorite,
switchCategory,
toggleFavorite,