mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Removed cache logic for websites.
This commit is contained in:
parent
2620e8fe26
commit
439f8a8aa3
1 changed files with 5 additions and 26 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import { Prisma, Website } from '@prisma/client';
|
import { Prisma, Website } from '@prisma/client';
|
||||||
import cache from 'lib/cache';
|
|
||||||
import prisma from 'lib/prisma';
|
import prisma from 'lib/prisma';
|
||||||
import { FilterResult, WebsiteSearchFilter } from 'lib/types';
|
import { FilterResult, WebsiteSearchFilter } from 'lib/types';
|
||||||
import WebsiteFindManyArgs = Prisma.WebsiteFindManyArgs;
|
import WebsiteFindManyArgs = Prisma.WebsiteFindManyArgs;
|
||||||
|
|
@ -102,17 +101,9 @@ export async function getTeamWebsites(
|
||||||
export async function createWebsite(
|
export async function createWebsite(
|
||||||
data: Prisma.WebsiteCreateInput | Prisma.WebsiteUncheckedCreateInput,
|
data: Prisma.WebsiteCreateInput | Prisma.WebsiteUncheckedCreateInput,
|
||||||
): Promise<Website> {
|
): Promise<Website> {
|
||||||
return prisma.client.website
|
return prisma.client.website.create({
|
||||||
.create({
|
data,
|
||||||
data,
|
});
|
||||||
})
|
|
||||||
.then(async data => {
|
|
||||||
if (cache.enabled) {
|
|
||||||
await cache.storeWebsite(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateWebsite(
|
export async function updateWebsite(
|
||||||
|
|
@ -148,13 +139,7 @@ export async function resetWebsite(
|
||||||
resetAt: new Date(),
|
resetAt: new Date(),
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
]).then(async data => {
|
]);
|
||||||
if (cache.enabled) {
|
|
||||||
await cache.storeWebsite(data[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteWebsite(
|
export async function deleteWebsite(
|
||||||
|
|
@ -188,11 +173,5 @@ export async function deleteWebsite(
|
||||||
: client.website.delete({
|
: client.website.delete({
|
||||||
where: { id: websiteId },
|
where: { id: websiteId },
|
||||||
}),
|
}),
|
||||||
]).then(async data => {
|
]);
|
||||||
if (cache.enabled) {
|
|
||||||
await cache.deleteWebsite(websiteId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return data;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue