Add and delete migration files
This commit is contained in:
19
src/routes/worldtravel/+page.server.ts
Normal file
19
src/routes/worldtravel/+page.server.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { redirect } from "@sveltejs/kit";
|
||||
import type { PageServerLoad } from "./$types";
|
||||
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");
|
||||
}
|
||||
let response = await db
|
||||
.select()
|
||||
.from(worldTravelCountries)
|
||||
|
||||
// let array = result.adventures as Adventure[];
|
||||
return {
|
||||
response,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user