Correction booléen asynchrone

This commit is contained in:
2024-12-11 23:39:47 +01:00
parent af14cfb11d
commit 54a7806316
5 changed files with 10 additions and 11 deletions

View File

@ -37,7 +37,7 @@ export class ChallengeActionsService {
}
async update(id: number, updateChallengeActionDto: UpdateChallengeActionDto): Promise<ChallengeAction> {
if (!this.findOne(id))
if (!await this.findOne(id))
throw new NotFoundException(`Aucune action de défi trouvée avec l'identifiant ${id}`)
return await this.prisma.challengeAction.update({
where: { id },
@ -46,7 +46,7 @@ export class ChallengeActionsService {
}
async remove(id: number): Promise<ChallengeAction> {
if (!this.findOne(id))
if (!await this.findOne(id))
throw new NotFoundException(`Aucune action de défi trouvée avec l'identifiant ${id}`)
return await this.prisma.challengeAction.delete({
where: { id },