Remove unnecessary database migration scripts and update info modal text

This commit is contained in:
Sean Morley
2024-04-13 19:48:53 +00:00
parent 11ace187a7
commit fd1b85609e
48 changed files with 134 additions and 5947 deletions

View File

@@ -50,7 +50,7 @@
class="text-primary-500 underline">Source Code</a
>
</p>
<p class="py-1">Made with ❤️ in Connecticut.</p>
<p class="py-1">Made with ❤️ in the United States.</p>
<div
class="modal-action items-center"
style="display: flex; flex-direction: column; align-items: center; width: 100%;"

View File

@@ -70,11 +70,11 @@
<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={goToWorldTravel}>World Tavel Log</button
>
{/if}
<button
class="btn btn-primary my-2 md:my-0 md:mr-4"
on:click={goToWorldTravel}>World Tavel Log</button
>
<button class="btn btn-primary my-2 md:my-0" on:click={goToFeatured}
>Featured</button
>

View File

@@ -66,4 +66,14 @@ export const worldTravelCountryRegions = pgTable("worldTravelCountryRegions", {
country_code: text("country_code")
.notNull()
.references(() => worldTravelCountries.country_code),
});
export const userVisitedWorldTravel = pgTable("userVisitedWorldTravel", {
id: serial("id").primaryKey(),
userId: text("user_id")
.notNull()
.references(() => userTable.id),
region_id: varchar("region_id")
.notNull()
.references(() => worldTravelCountryRegions.id),
});

View File

@@ -5,15 +5,8 @@
import AdventureCard from "$lib/components/AdventureCard.svelte";
import type { Adventure } from "$lib/utils/types";
import {
addAdventure,
clearAdventures,
getAdventures,
getNextId,
} from "../../services/adventureService";
import { onMount } from "svelte";
import { exportData } from "../../services/export";
import { importData } from "../../services/import";
import exportFile from "$lib/assets/exportFile.svg";
import deleteIcon from "$lib/assets/deleteIcon.svg";
import SucessToast from "$lib/components/SucessToast.svelte";

View File

@@ -4,10 +4,10 @@ import type { Adventure } from "$lib/utils/types";
import { db } from "$lib/db/db.server";
import { worldTravelCountries } from "$lib/db/schema";
export const load: PageServerLoad = async (event) => {
if (!event.locals.user) {
return redirect(302, "/login");
}
export const load: PageServerLoad = async () => {
// if (!event.locals.user) {
// return redirect(302, "/login");
// }
let response = await db
.select()
.from(worldTravelCountries)

View File

@@ -3,7 +3,6 @@
import AdventureCard from "$lib/components/AdventureCard.svelte";
export let data: any;
console.log(data.response);
async function nav(loc: string) {
goto(`/worldtravel/${loc}`);

View File

@@ -2,14 +2,15 @@
import { db } from '$lib/db/db.server.js';
import { worldTravelCountryRegions } from '$lib/db/schema.js';
import { eq } from 'drizzle-orm';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ params, locals }) => {
export async function load({ params }) {
const { countrycode } = params;
let data = await db
.select()
.from(worldTravelCountryRegions)
.where(eq(worldTravelCountryRegions.country_code, countrycode))
console.log(data)
return {
regions : data,
};