Rename method to transaction.

This commit is contained in:
Mike Cao 2022-08-29 00:02:38 -07:00
parent f4e0da481e
commit 5f07cecc95
3 changed files with 6 additions and 6 deletions

View File

@ -180,7 +180,7 @@ async function rawQuery(query, params = []) {
return prisma.$queryRawUnsafe.apply(prisma, [sql, ...params]);
}
async function multiQuery(queries) {
async function transaction(queries) {
return prisma.$transaction(queries);
}
@ -195,5 +195,5 @@ export default {
getFilterQuery,
parseFilters,
rawQuery,
multiQuery,
transaction,
};

View File

@ -2,9 +2,9 @@ import prisma from 'lib/prisma';
import redis from 'lib/redis';
export async function deleteWebsite(website_id) {
const { client, multiQuery } = prisma;
const { client, transaction } = prisma;
return multiQuery([
return transaction([
client.pageview.deleteMany({
where: { session: { website: { website_id } } },
}),

View File

@ -2,9 +2,9 @@ import prisma from 'lib/prisma';
import redis from 'lib/redis';
export async function resetWebsite(website_id) {
const { client, multiQuery } = prisma;
const { client, transaction } = prisma;
return multiQuery([
return transaction([
client.pageview.deleteMany({
where: { session: { website: { website_id } } },
}),