umami/queries/admin/website/getWebsite.js

17 lines
347 B
JavaScript
Raw Normal View History

2022-10-06 23:18:27 +02:00
import prisma from 'lib/prisma';
import redis from 'lib/redis';
2022-10-06 23:18:27 +02:00
export async function getWebsite(where) {
return prisma.client.website
.findUnique({
where,
})
.then(async data => {
if (redis.enabled && data) {
await redis.client.set(`website:${data.websiteUuid}`, data.id);
}
return data;
});
2022-10-06 23:18:27 +02:00
}