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