Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Removed cache logic for websites.

Mike Cao439f8a8aa342
diff --git a/src/queries/admin/website.ts b/src/queries/admin/website.ts
index cef7f15d2..949efb715 100644
--- a/src/queries/admin/website.ts
+++ b/src/queries/admin/website.ts
@@ -1,5 +1,4 @@
import { Prisma, Website } from '@prisma/client';
-import cache from 'lib/cache';
import prisma from 'lib/prisma';
import { FilterResult, WebsiteSearchFilter } from 'lib/types';
import WebsiteFindManyArgs = Prisma.WebsiteFindManyArgs;
@@ -102,17 +101,9 @@ export async function getTeamWebsites(
export async function createWebsite(
data: Prisma.WebsiteCreateInput | Prisma.WebsiteUncheckedCreateInput,
): Promise<Website> {
- return prisma.client.website
- .create({
- data,
- })
- .then(async data => {
- if (cache.enabled) {
- await cache.storeWebsite(data);
- }
-
- return data;
- });
+ return prisma.client.website.create({
+ data,
+ });
}
export async function updateWebsite(
@@ -148,13 +139,7 @@ export async function resetWebsite(
resetAt: new Date(),
},
}),
- ]).then(async data => {
- if (cache.enabled) {
- await cache.storeWebsite(data[3]);
- }
-
- return data;
- });
+ ]);
}
export async function deleteWebsite(
@@ -188,11 +173,5 @@ export async function deleteWebsite(
: client.website.delete({
where: { id: websiteId },
}),
- ]).then(async data => {
- if (cache.enabled) {
- await cache.deleteWebsite(websiteId);
- }
-
- return data;
- });
+ ]);
}