Add log page, update database schema, and API endpoint for user visits

This commit is contained in:
Sean Morley
2024-04-06 12:54:17 +00:00
parent 1b9edeb61f
commit ea79fd2d76
8 changed files with 245 additions and 11 deletions

View File

@@ -43,10 +43,12 @@
class="btn btn-primary my-2 md:my-0 md:mr-4 md:ml-2"
on:click={goHome}>Home</button
>
<button
class="btn btn-primary my-2 md:my-0 md:mr-4 md:ml-2"
on:click={goToLog}>My Log</button
>
{#if user}
<button
class="btn btn-primary my-2 md:my-0 md:mr-4 md:ml-2"
on:click={goToLog}>My Log</button
>
{/if}
<button class="btn btn-primary my-2 md:my-0" on:click={goToFeatured}
>Featured</button
>

View File

@@ -40,10 +40,11 @@ export const sessionTable = pgTable("session", {
});
export const userVisitedAdventures = pgTable("userVisitedAdventures", {
adventureID: serial("adventure_id").primaryKey(),
userId: text("user_id")
.notNull()
.references(() => userTable.id),
adventureName: text("adventure_name").notNull(),
location: text("location"),
adventureVistied: text("adventure_visited"),
visitedDate: text("visited_date"),
});