mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 16:45:35 +01:00
Remove password.
This commit is contained in:
parent
cf14a7a04f
commit
1aa407027e
1 changed files with 17 additions and 9 deletions
|
|
@ -37,7 +37,7 @@ export async function getUserByUsername(username: string, options: GetUserOption
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getUsers(
|
export async function getUsers(
|
||||||
UserSearchFilter: UserSearchFilter = {},
|
UserSearchFilter: UserSearchFilter,
|
||||||
options?: { include?: Prisma.UserInclude },
|
options?: { include?: Prisma.UserInclude },
|
||||||
): Promise<FilterResult<User[]>> {
|
): Promise<FilterResult<User[]>> {
|
||||||
const { teamId, filter, filterType = USER_FILTER_TYPES.all } = UserSearchFilter;
|
const { teamId, filter, filterType = USER_FILTER_TYPES.all } = UserSearchFilter;
|
||||||
|
|
@ -72,14 +72,22 @@ export async function getUsers(
|
||||||
...UserSearchFilter,
|
...UserSearchFilter,
|
||||||
});
|
});
|
||||||
|
|
||||||
const users = await prisma.client.user.findMany({
|
const users = await prisma.client.user
|
||||||
where: {
|
.findMany({
|
||||||
...where,
|
where: {
|
||||||
deletedAt: null,
|
...where,
|
||||||
},
|
deletedAt: null,
|
||||||
...pageFilters,
|
},
|
||||||
...(options?.include && { include: options.include }),
|
...pageFilters,
|
||||||
});
|
...(options?.include && { include: options.include }),
|
||||||
|
})
|
||||||
|
.then(a => {
|
||||||
|
return a.map(a => {
|
||||||
|
const { password, ...rest } = a;
|
||||||
|
|
||||||
|
return rest;
|
||||||
|
});
|
||||||
|
});
|
||||||
const count = await prisma.client.user.count({
|
const count = await prisma.client.user.count({
|
||||||
where: {
|
where: {
|
||||||
...where,
|
...where,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue