From 023efad91b57e04a82fa187a43d4dd63f8b4717c Mon Sep 17 00:00:00 2001 From: MohamedAliBouhaouala Date: Wed, 23 Apr 2025 18:21:00 +0100 Subject: [PATCH] fix: remove blank line, make updateOne asynchronous --- api/src/nlp/services/nlp-entity.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/nlp/services/nlp-entity.service.ts b/api/src/nlp/services/nlp-entity.service.ts index 22ad5f3b..6313f8b2 100644 --- a/api/src/nlp/services/nlp-entity.service.ts +++ b/api/src/nlp/services/nlp-entity.service.ts @@ -45,6 +45,7 @@ export class NlpEntityService extends BaseService< async deleteCascadeOne(id: string) { return await this.repository.deleteOne(id); } + /** * Updates the `weight` field of a specific NLP entity by its ID. * @@ -55,13 +56,12 @@ export class NlpEntityService extends BaseService< * @throws Error if the weight is not a positive integer. * @returns A promise that resolves to the updated entity. */ - async updateWeight(id: string, updatedWeight: number) { if (!Number.isInteger(updatedWeight) || updatedWeight < 1) { throw new Error('Weight must be a positive integer'); } - return this.repository.updateOne( + return await this.repository.updateOne( id, { weight: updatedWeight }, { new: true },