mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Update teams features.
This commit is contained in:
parent
89f2fd601e
commit
656df4f846
23 changed files with 278 additions and 113 deletions
|
|
@ -47,18 +47,22 @@ export async function getUsers(): Promise<User[]> {
|
|||
}
|
||||
|
||||
export async function getUserTeams(userId: string): Promise<Team[]> {
|
||||
return prisma.client.teamUser
|
||||
.findMany({
|
||||
where: {
|
||||
userId,
|
||||
return prisma.client.team.findMany({
|
||||
where: {
|
||||
teamUsers: {
|
||||
some: {
|
||||
userId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
team: true,
|
||||
},
|
||||
include: {
|
||||
teamUsers: {
|
||||
include: {
|
||||
user: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
.then(data => {
|
||||
return data.map(a => a.team);
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function getUserWebsites(userId: string): Promise<Website[]> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue