mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Fixed share page. Updated device detect. Updated teams fetch.
This commit is contained in:
parent
27c342811e
commit
1b400da7b2
16 changed files with 118 additions and 109 deletions
|
|
@ -42,7 +42,7 @@ export async function getTeams(
|
|||
);
|
||||
}
|
||||
|
||||
export async function getUserTeams(userId: string, filters: QueryFilters) {
|
||||
export async function getUserTeams(userId: string, filters: QueryFilters = {}) {
|
||||
return getTeams(
|
||||
{
|
||||
where: {
|
||||
|
|
@ -80,6 +80,22 @@ export async function getUserTeams(userId: string, filters: QueryFilters) {
|
|||
);
|
||||
}
|
||||
|
||||
export async function getAllUserTeams(userId: string) {
|
||||
return prisma.client.team.findMany({
|
||||
where: {
|
||||
deletedAt: null,
|
||||
members: {
|
||||
some: { userId },
|
||||
},
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
logoUrl: true,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export async function createTeam(data: Prisma.TeamCreateInput, userId: string): Promise<any> {
|
||||
const { id } = data;
|
||||
const { client, transaction } = prisma;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue