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.

Merge branch 'dev' of https://github.com/umami-software/umami into dev

Mike Cao4cb5a14de989
diff --cc queries/admin/user.ts
index 9455c3116,2b7677f9e..9be6bc370
--- a/queries/admin/user.ts
+++ b/queries/admin/user.ts
@@@ -1,16 -1,23 +1,16 @@@
import { Prisma, Team } from '@prisma/client';
import cache from 'lib/cache';
import prisma from 'lib/prisma';
-import { Website } from 'lib/types';
-
-export interface User {
- id: string;
- username: string;
- password?: string;
- createdAt?: Date;
-}
+import { Website, User } from 'lib/types';
export async function getUser(
- where: Prisma.UserWhereUniqueInput,
- options: { includePassword?: boolean } = {},
+ where: Prisma.UserWhereInput | Prisma.UserWhereUniqueInput,
+ options: { includePassword?: boolean; showDeleted?: boolean } = {},
): Promise<User> {
- const { includePassword = false } = options;
+ const { includePassword = false, showDeleted = false } = options;
- return prisma.client.user.findUnique({
- where,
+ return prisma.client.user.findFirst({
+ where: { ...where, ...(showDeleted ? {} : { deletedAt: null }) },
select: {
id: true,
username: true,