- auth: actionDeleteAccount 改用 service+repo,forgot-password 完整三层实现 - card: serviceCheckCardOwnership 替代直接调用 repository - deck: 移除 service 层的 use server 指令 - dictionary: 数据转换逻辑从 repository 移到 service - ocr: 认证移到 action 层,跨模块调用改用 service - translator: genIPA/genLanguage 改用 service 层
20 lines
567 B
TypeScript
20 lines
567 B
TypeScript
import { prisma } from "@/lib/db";
|
|
import { createLogger } from "@/lib/logger";
|
|
import {
|
|
RepoInputFindUserByEmail,
|
|
RepoOutputFindUserByEmail
|
|
} from "./forgot-password-repository-dto";
|
|
|
|
const log = createLogger("forgot-password-repository");
|
|
|
|
export async function repoFindUserByEmail(dto: RepoInputFindUserByEmail): Promise<RepoOutputFindUserByEmail> {
|
|
log.debug("Finding user by email", { email: dto.email });
|
|
|
|
const user = await prisma.user.findUnique({
|
|
where: { email: dto.email },
|
|
select: { id: true },
|
|
});
|
|
|
|
return user;
|
|
}
|