mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
17 lines
340 B
JavaScript
17 lines
340 B
JavaScript
import prisma from 'lib/prisma';
|
|
import redis from 'lib/redis';
|
|
|
|
export async function getWebsite(where) {
|
|
return prisma.client.website
|
|
.findUnique({
|
|
where,
|
|
})
|
|
.then(async data => {
|
|
if (redis.enabled && data) {
|
|
await redis.set(`website:${data.websiteUuid}`, data.id);
|
|
}
|
|
|
|
return data;
|
|
});
|
|
}
|