umami/queries/admin/website/getWebsiteByUuid.js
2022-08-29 13:04:58 -07:00

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;
});
}