Chart component. Update web utils.
This commit is contained in:
@@ -11,7 +11,7 @@ export const prisma = new PrismaClient({
|
||||
|
||||
prisma.on('query', e => {
|
||||
if (process.env.LOG_QUERY) {
|
||||
console.log(`${e.query} (${e.duration}ms)`);
|
||||
console.log(`${e.params} -> ${e.query} (${e.duration}ms)`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -113,11 +113,15 @@ export async function getAccount(username = '') {
|
||||
);
|
||||
}
|
||||
|
||||
export async function getPageviews(website_id) {
|
||||
export async function getPageviews(website_id, start_at, end_at) {
|
||||
return runQuery(
|
||||
prisma.pageview.findMany({
|
||||
where: {
|
||||
website_id,
|
||||
created_at: {
|
||||
gte: start_at,
|
||||
lte: end_at,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user