1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-28 09:19:37 +02:00

feat: Add markVisited function to AdventureCard.svelte and +page.svelte

The code changes include adding a new function called markVisited to the AdventureCard.svelte and +page.svelte files. This function is responsible for marking an adventure as visited and dispatching an event to update the adventure's status. This enhancement allows users to mark adventures as visited in the planner page and triggers the corresponding API request to update the adventure's status in the database.
This commit is contained in:
Sean Morley 2024-05-05 19:06:23 +00:00
parent 4069bc5052
commit ca7592989a
4 changed files with 110 additions and 1 deletions

View file

@ -31,6 +31,10 @@
console.log(adventure.id);
goto(`/adventure/${adventure.id}`);
}
function markVisited() {
console.log(adventure.id);
dispatch("markVisited", adventure);
}
</script>
<div
@ -77,6 +81,10 @@
>
{/if}
{#if type == "planner"}
<button class="btn btn-success" on:click={markVisited}
><iconify-icon icon="mdi:check-bold" class="text-2xl"
></iconify-icon></button
>
<button class="btn btn-primary" on:click={moreInfo}
><iconify-icon icon="mdi:launch" class="text-2xl"
></iconify-icon></button