mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-02 03:35:18 +02:00
Fix deletion issue
This commit is contained in:
parent
4fd174530b
commit
cb2470070b
1 changed files with 6 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue