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 { 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…
Reference in New Issue
Block a user