mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Remove sensitive user information.
This commit is contained in:
parent
6d5aeb3bd1
commit
44e6bff6b1
3 changed files with 32 additions and 9 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Prisma, Team } from '@prisma/client';
|
||||
import { Prisma, Team, TeamUser } from '@prisma/client';
|
||||
import cache from 'lib/cache';
|
||||
import { ROLES } from 'lib/constants';
|
||||
import prisma from 'lib/prisma';
|
||||
|
|
@ -40,7 +40,13 @@ export async function getUsers(): Promise<User[]> {
|
|||
});
|
||||
}
|
||||
|
||||
export async function getUserTeams(userId: string): Promise<Team[]> {
|
||||
export async function getUserTeams(userId: string): Promise<
|
||||
(Team & {
|
||||
teamUser: (TeamUser & {
|
||||
user: { id: string; username: string };
|
||||
})[];
|
||||
})[]
|
||||
> {
|
||||
return prisma.client.team.findMany({
|
||||
where: {
|
||||
teamUser: {
|
||||
|
|
@ -52,7 +58,12 @@ export async function getUserTeams(userId: string): Promise<Team[]> {
|
|||
include: {
|
||||
teamUser: {
|
||||
include: {
|
||||
user: true,
|
||||
user: {
|
||||
select: {
|
||||
id: true,
|
||||
username: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue