Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Remove password.

Brian Cao1aa407027ee2
diff --git a/queries/admin/user.ts b/queries/admin/user.ts
index dfb923f31..ca459b9fd 100644
--- a/queries/admin/user.ts
+++ b/queries/admin/user.ts
@@ -37,7 +37,7 @@ export async function getUserByUsername(username: string, options: GetUserOption
}
export async function getUsers(
- UserSearchFilter: UserSearchFilter = {},
+ UserSearchFilter: UserSearchFilter,
options?: { include?: Prisma.UserInclude },
): Promise<FilterResult<User[]>> {
const { teamId, filter, filterType = USER_FILTER_TYPES.all } = UserSearchFilter;
@@ -72,14 +72,22 @@ export async function getUsers(
...UserSearchFilter,
});
- const users = await prisma.client.user.findMany({
- where: {
- ...where,
- deletedAt: null,
- },
- ...pageFilters,
- ...(options?.include && { include: options.include }),
- });
+ const users = await prisma.client.user
+ .findMany({
+ where: {
+ ...where,
+ deletedAt: null,
+ },
+ ...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({
where: {
...where,