Add DELETE endpoint to visits API and update log page
This commit is contained in:
@@ -7,13 +7,13 @@ import { visitCount } from "$lib/utils/stores/visitCountStore";
|
||||
// Check if localStorage is available (browser environment)
|
||||
const isBrowser = typeof window !== "undefined";
|
||||
|
||||
// Load adventures from localStorage on startup (only in the browser)
|
||||
if (isBrowser) {
|
||||
const storedAdventures = localStorage.getItem("adventures");
|
||||
if (storedAdventures) {
|
||||
adventures = JSON.parse(storedAdventures);
|
||||
}
|
||||
}
|
||||
// // Load adventures from localStorage on startup (only in the browser)
|
||||
// if (isBrowser) {
|
||||
// const storedAdventures = localStorage.getItem("adventures");
|
||||
// if (storedAdventures) {
|
||||
// adventures = JSON.parse(storedAdventures);
|
||||
// }
|
||||
// }
|
||||
|
||||
export function getNextId() {
|
||||
let nextId = Math.max(0, ...adventures.map((adventure) => adventure.id)) + 1;
|
||||
|
||||
Reference in New Issue
Block a user