fix: 修复创建分享接口报错
This commit is contained in:
@@ -43,7 +43,7 @@ export class ShareParticipantRepository {
|
||||
const rows = await this.repository
|
||||
.createQueryBuilder('participant')
|
||||
.select('participant.shareConfigId', 'shareConfigId')
|
||||
.addSelect('COUNT(participant.id)', 'participantCount')
|
||||
.addSelect('COUNT(*)', 'participantCount')
|
||||
.where('participant.shareConfigId IN (:...shareConfigIds)', {
|
||||
shareConfigIds,
|
||||
})
|
||||
@@ -55,18 +55,13 @@ export class ShareParticipantRepository {
|
||||
);
|
||||
}
|
||||
|
||||
async findByShareConfigAndParticipant(
|
||||
async existsByShareConfigAndParticipant(
|
||||
shareConfigId: string,
|
||||
participantId: string,
|
||||
): Promise<ShareParticipant | null> {
|
||||
return this.repository.findOne({ where: { shareConfigId, participantId } });
|
||||
}
|
||||
|
||||
create(data: Partial<ShareParticipant>): ShareParticipant {
|
||||
return this.repository.create(data);
|
||||
}
|
||||
|
||||
async save(participant: ShareParticipant): Promise<ShareParticipant> {
|
||||
return this.repository.save(participant);
|
||||
): Promise<boolean> {
|
||||
const count = await this.repository.count({
|
||||
where: { shareConfigId, participantId },
|
||||
});
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user