mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-04 17:56:38 +00:00
delete resources on delete org
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Request, Response, NextFunction } from "express";
|
import { Request, Response, NextFunction } from "express";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { db } from "@server/db";
|
import { db, resources } from "@server/db";
|
||||||
import {
|
import {
|
||||||
newts,
|
newts,
|
||||||
newtSessions,
|
newtSessions,
|
||||||
@@ -127,6 +127,7 @@ export async function deleteOrg(
|
|||||||
}
|
}
|
||||||
|
|
||||||
await trx.delete(orgs).where(eq(orgs.orgId, orgId));
|
await trx.delete(orgs).where(eq(orgs.orgId, orgId));
|
||||||
|
await trx.delete(resources).where(eq(resources.orgId, orgId));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send termination messages outside of transaction to prevent blocking
|
// Send termination messages outside of transaction to prevent blocking
|
||||||
|
|||||||
Reference in New Issue
Block a user