mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-01 12:29:35 +01:00
Removed cache logic for websites.
This commit is contained in:
parent
2620e8fe26
commit
439f8a8aa3
@ -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;
|
||||
});
|
||||
]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user