mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
delete website in relational query
This commit is contained in:
parent
d60ad1c782
commit
5da7a208a8
@ -97,9 +97,7 @@ export async function deleteWebsite(websiteId: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteWebsiteRelationalQuery(
|
async function deleteWebsiteRelationalQuery(websiteId,): Promise<[Prisma.BatchPayload, Prisma.BatchPayload, Website]> {
|
||||||
websiteId,
|
|
||||||
): Promise<[Prisma.BatchPayload, Prisma.BatchPayload, Website]> {
|
|
||||||
const { client, transaction } = prisma;
|
const { client, transaction } = prisma;
|
||||||
|
|
||||||
return transaction([
|
return transaction([
|
||||||
@ -109,10 +107,7 @@ async function deleteWebsiteRelationalQuery(
|
|||||||
client.session.deleteMany({
|
client.session.deleteMany({
|
||||||
where: { websiteId },
|
where: { websiteId },
|
||||||
}),
|
}),
|
||||||
client.website.update({
|
client.website.delete({
|
||||||
data: {
|
|
||||||
isDeleted: true,
|
|
||||||
},
|
|
||||||
where: { id: websiteId },
|
where: { id: websiteId },
|
||||||
}),
|
}),
|
||||||
]).then(async data => {
|
]).then(async data => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user