Refactor database schema and add planner functionality
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
export let regionId: String | undefined = undefined;
|
||||
export let visited: Boolean | undefined = undefined;
|
||||
export let countryCode: String | undefined = undefined;
|
||||
export let activityTypes: String[] | undefined = undefined;
|
||||
|
||||
function remove() {
|
||||
dispatch("remove", id);
|
||||
@@ -126,3 +127,25 @@
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if type === "planner"}
|
||||
<div
|
||||
class="card min-w-max lg:w-96 md:w-80 sm:w-60 xs:w-40 bg-primary-content shadow-xl overflow-hidden text-base-content"
|
||||
>
|
||||
<div class="card-body">
|
||||
<h2 class="card-title overflow-ellipsis">{name}</h2>
|
||||
{#if location != ""}
|
||||
<div class="inline-flex items-center">
|
||||
<iconify-icon icon="mdi:map-marker" class="text-xl"></iconify-icon>
|
||||
<p class="ml-.5">{location}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{#if activityTypes && activityTypes.length > 0}
|
||||
<p>{activityTypes}</p>
|
||||
{/if}
|
||||
<div class="card-actions justify-end">
|
||||
<button class="btn btn-primary" on:click={add}>Add</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -78,6 +78,10 @@
|
||||
<button class="btn btn-primary my-2 md:my-0 md:mr-4" on:click={goToLog}
|
||||
>My Log</button
|
||||
>
|
||||
<button
|
||||
class="btn btn-primary my-2 md:my-0 md:mr-4"
|
||||
on:click={() => goto("/planner")}>Planner</button
|
||||
>
|
||||
{/if}
|
||||
<button
|
||||
class="btn btn-primary my-2 md:my-0 md:mr-4"
|
||||
|
||||
@@ -89,4 +89,14 @@ export const userVisitedWorldTravel = pgTable("userVisitedWorldTravel", {
|
||||
region_id: varchar("region_id")
|
||||
.notNull()
|
||||
.references(() => worldTravelCountryRegions.id),
|
||||
});
|
||||
});
|
||||
|
||||
export const userPlannedAdventures = pgTable("userPlannedAdventures", {
|
||||
id: serial("id").primaryKey(),
|
||||
userId: text("userId")
|
||||
.notNull()
|
||||
.references(() => userTable.id),
|
||||
name: text("adventureName").notNull(),
|
||||
location: text("location"),
|
||||
activityTypes: json("activityTypes"),
|
||||
});
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
export interface Adventure {
|
||||
id: number;
|
||||
name: string;
|
||||
location: string;
|
||||
created: string;
|
||||
id?: number;
|
||||
name?: string;
|
||||
location?: string | undefined;
|
||||
created?: string | undefined;
|
||||
description?: string | undefined;
|
||||
activityTypes?: string[] | undefined;
|
||||
}
|
||||
|
||||
export interface RegionInfo {
|
||||
@@ -36,4 +38,4 @@ export interface RegionInfo {
|
||||
attractions: string[];
|
||||
};
|
||||
major_sports_teams: string[];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user