mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
19 lines
392 B
JavaScript
19 lines
392 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 (process.env.REDIS_URL && res) {
|
|
await redis.client.set(`website:${res.website_uuid}`, 1);
|
|
}
|
|
|
|
return res;
|
|
});
|
|
}
|