mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-03-25 17:51:23 -04:00
Fix deletion issue
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { db } from "$lib/db/db.server";
|
||||
import { userPlannedTrips } from "$lib/db/schema";
|
||||
import { adventureTable, userPlannedTrips } from "$lib/db/schema";
|
||||
import { error, type RequestEvent } from "@sveltejs/kit";
|
||||
import { and, eq } from "drizzle-orm";
|
||||
import type { Trip } from "$lib/utils/types";
|
||||
@@ -103,6 +103,11 @@ export async function DELETE(event: RequestEvent): Promise<Response> {
|
||||
});
|
||||
}
|
||||
|
||||
let deleted = await db
|
||||
.delete(adventureTable)
|
||||
.where(eq(adventureTable.tripId, body.id))
|
||||
.execute();
|
||||
|
||||
let res = await db
|
||||
.delete(userPlannedTrips)
|
||||
.where(
|
||||
|
||||
Reference in New Issue
Block a user