From 879b182e56b1daa5930a61a3be07f6b4d923364c Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Wed, 7 Aug 2024 17:36:25 -0400 Subject: [PATCH] chore: Update CollectionCard component to display correct toast message when archiving/unarchiving a collection --- .../src/lib/components/CollectionCard.svelte | 4 ++-- .../src/routes/collections/[id]/+page.svelte | 22 ++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/frontend/src/lib/components/CollectionCard.svelte b/frontend/src/lib/components/CollectionCard.svelte index f8005b4f..7696c749 100644 --- a/frontend/src/lib/components/CollectionCard.svelte +++ b/frontend/src/lib/components/CollectionCard.svelte @@ -37,10 +37,10 @@ }); if (res.ok) { console.log(`Collection ${is_archived ? 'archived' : 'unarchived'}`); - addToast('info', `Adventure ${is_archived ? 'archived' : 'unarchived'} successfully!`); + addToast('info', `Collection ${is_archived ? 'archived' : 'unarchived'} successfully!`); dispatch('delete', collection.id); } else { - console.log('Error archiving adventure'); + console.log('Error archiving collection'); } } diff --git a/frontend/src/routes/collections/[id]/+page.svelte b/frontend/src/routes/collections/[id]/+page.svelte index 5fd0e099..e78e6b4d 100644 --- a/frontend/src/routes/collections/[id]/+page.svelte +++ b/frontend/src/routes/collections/[id]/+page.svelte @@ -287,7 +287,7 @@ {/if} {#if collection} - {#if data.user} + {#if data.user && !collection.is_archived}
{/if} + {#if collection.is_archived} +
+ +
+ {/if} {#if collection.name}

{collection.name}

{/if}