api and lib fixes (#1643)
This commit is contained in:
@@ -12,10 +12,8 @@ export function getEvents(...args) {
|
||||
function relationalQuery(websites, start_at) {
|
||||
return prisma.client.event.findMany({
|
||||
where: {
|
||||
website: {
|
||||
id: {
|
||||
in: websites,
|
||||
},
|
||||
websiteId: {
|
||||
in: websites,
|
||||
},
|
||||
createdAt: {
|
||||
gte: start_at,
|
||||
|
||||
@@ -12,10 +12,8 @@ export async function getPageviews(...args) {
|
||||
async function relationalQuery(websites, start_at) {
|
||||
return prisma.client.pageview.findMany({
|
||||
where: {
|
||||
website: {
|
||||
id: {
|
||||
in: websites,
|
||||
},
|
||||
websiteId: {
|
||||
in: websites,
|
||||
},
|
||||
createdAt: {
|
||||
gte: start_at,
|
||||
|
||||
@@ -14,10 +14,8 @@ async function relationalQuery(websites, start_at) {
|
||||
where: {
|
||||
...(websites && websites.length > 0
|
||||
? {
|
||||
website: {
|
||||
id: {
|
||||
in: websites,
|
||||
},
|
||||
websiteId: {
|
||||
in: websites,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
|
||||
Reference in New Issue
Block a user