Refactor adventure category handling: update type definitions, enhance category management in UI components, and implement user-specific category deletion logic in the backend

This commit is contained in:
Sean Morley
2024-11-23 13:42:41 -05:00
parent 736ede2417
commit 8e5a20ec62
12 changed files with 324 additions and 93 deletions

View File

@@ -265,7 +265,9 @@
<div>
<p class="text-sm text-muted-foreground">{$t('adventures.adventure_type')}</p>
<p class="text-base font-medium">
{`${adventure.category.display_name} ${adventure.category.icon}`}
{typeof adventure.category === 'object'
? `${adventure.category.display_name} ${adventure.category.icon}`
: ''}
</p>
</div>
{#if data.props.collection}
@@ -337,8 +339,8 @@
<Popup openOn="click" offset={[0, -10]}>
<div class="text-lg text-black font-bold">{adventure.name}</div>
<p class="font-semibold text-black text-md">
{adventure.category.display_name}
{adventure.category.icon}
{typeof adventure.category === 'object' && adventure.category.display_name}
{typeof adventure.category === 'object' && adventure.category.icon}
</p>
{#if adventure.visits.length > 0}
<p class="text-black text-sm">