Correction booléen asynchrone
This commit is contained in:
@ -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 },
|
||||
|
Reference in New Issue
Block a user