umami/queries/admin/website/getWebsite.js
2022-11-07 16:22:49 -08:00

17 lines
328 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.id}`, data);
}
return data;
});
}