Added new trip plan creator and removed visit count stores

This commit is contained in:
Sean Morley
2024-05-06 23:13:32 +00:00
parent 75da1f4cc6
commit 01865951ac
19 changed files with 967 additions and 522 deletions

View File

@@ -1,4 +1,3 @@
import { visitCount } from "$lib/utils/stores/visitCountStore";
import type { Adventure } from "$lib/utils/types";
/**
@@ -112,9 +111,6 @@ export async function addAdventure(
.then((response) => response.json())
.then((data) => {
adventureArray.push(data.adventure);
if (data.adventure.type === "mylog") {
incrementVisitCount(1);
}
})
.catch((error) => {
console.error("Error:", error);
@@ -155,10 +151,3 @@ export async function changeType(
return adventureArray;
}
/**
* Increments the visit count by the specified amount.
* @param {number} amount - The amount to increment the visit count by.
*/
export function incrementVisitCount(amount: number) {
visitCount.update((n) => n + 1);
}