fix(injection): findUnique 使用命名唯一索引 uk_adoption_id
Prisma 的 @@unique 使用自定义名 "uk_adoption_id" 后,
findUnique 的 where 必须用 { uk_adoption_id: { adoptionId } }
而非 { adoptionId },否则报 PrismaClientValidationError。
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8980a169ed
commit
c93eeba79a
|
|
@ -44,7 +44,7 @@ export class AdoptionInjectionRecordRepositoryImpl implements IAdoptionInjection
|
|||
|
||||
async findByAdoptionId(adoptionId: string): Promise<AdoptionInjectionRecordDto | null> {
|
||||
const record = await this.prisma.adoptionInjectionRecord.findUnique({
|
||||
where: { adoptionId },
|
||||
where: { uk_adoption_id: { adoptionId } },
|
||||
});
|
||||
return record ? this.mapToDto(record) : null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue