mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
fix getReports for website, user, team
This commit is contained in:
parent
111c93be20
commit
d40807e672
3 changed files with 29 additions and 8 deletions
|
|
@ -66,11 +66,29 @@ export default async (
|
|||
const data = await getReports(
|
||||
{
|
||||
where: {
|
||||
userId: !teamId && !websiteId ? userId : undefined,
|
||||
websiteId,
|
||||
website: {
|
||||
teamId,
|
||||
},
|
||||
OR: [
|
||||
...(websiteId ? [{ websiteId }] : []),
|
||||
...(teamId
|
||||
? [
|
||||
{
|
||||
website: {
|
||||
deletedAt: null,
|
||||
teamId,
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(userId
|
||||
? [
|
||||
{
|
||||
website: {
|
||||
deletedAt: null,
|
||||
userId,
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
include: {
|
||||
website: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue