diff --git a/api/src/attachment/controllers/attachment.controller.ts b/api/src/attachment/controllers/attachment.controller.ts index fbc3717a..8a0ca6d4 100644 --- a/api/src/attachment/controllers/attachment.controller.ts +++ b/api/src/attachment/controllers/attachment.controller.ts @@ -153,7 +153,7 @@ export class AttachmentController extends BaseController { throw new NotFoundException('Attachment not found'); } - return this.attachmentService.download(attachment); + return await this.attachmentService.download(attachment); } /** diff --git a/api/src/cms/controllers/menu.controller.ts b/api/src/cms/controllers/menu.controller.ts index ab7b70a1..f2343d1d 100644 --- a/api/src/cms/controllers/menu.controller.ts +++ b/api/src/cms/controllers/menu.controller.ts @@ -164,8 +164,8 @@ export class MenuController extends BaseController< @CsrfCheck(true) @Patch(':id') async updateOne(@Body() body: MenuCreateDto, @Param('id') id: string) { - if (!id) return this.create(body); - return this.menuService.updateOne(id, body); + if (!id) return await this.create(body); + return await this.menuService.updateOne(id, body); } /** diff --git a/api/src/cms/repositories/content.repository.ts b/api/src/cms/repositories/content.repository.ts index 4dea95ce..77403b08 100644 --- a/api/src/cms/repositories/content.repository.ts +++ b/api/src/cms/repositories/content.repository.ts @@ -100,7 +100,7 @@ export class ContentRepository extends BaseRepository< * @returns A promise that resolves to the matching content documents. */ async textSearch(query: string) { - return this.find({ + return await this.find({ $text: { $search: query, $diacriticSensitive: false, diff --git a/api/src/cms/services/content.service.ts b/api/src/cms/services/content.service.ts index bdcac780..c73c5da5 100644 --- a/api/src/cms/services/content.service.ts +++ b/api/src/cms/services/content.service.ts @@ -49,7 +49,7 @@ export class ContentService extends BaseService< * @return A list of content matching the search query. */ async textSearch(query: string) { - return this.repository.textSearch(query); + return await this.repository.textSearch(query); } /** diff --git a/api/src/extensions/helpers/core-nlu/index.helper.ts b/api/src/extensions/helpers/core-nlu/index.helper.ts index 6a2ebd39..e92691b1 100644 --- a/api/src/extensions/helpers/core-nlu/index.helper.ts +++ b/api/src/extensions/helpers/core-nlu/index.helper.ts @@ -272,7 +272,7 @@ export default class CoreNluHelper extends BaseNlpHelper< }, ); - return this.filterEntitiesByConfidence(nlp, threshold); + return await this.filterEntitiesByConfidence(nlp, threshold); } catch (err) { this.logger.error('Core NLU Helper : Unable to parse nlp', err); throw err; diff --git a/api/src/i18n/controllers/translation.controller.ts b/api/src/i18n/controllers/translation.controller.ts index f4ab4e7c..9e571103 100644 --- a/api/src/i18n/controllers/translation.controller.ts +++ b/api/src/i18n/controllers/translation.controller.ts @@ -137,7 +137,7 @@ export class TranslationController extends BaseController { ); await Promise.all(queue); // Purge non existing translations - return this.translationService.deleteMany({ + return await this.translationService.deleteMany({ str: { $nin: strings }, }); } diff --git a/api/src/nlp/services/nlp-sample-entity.service.ts b/api/src/nlp/services/nlp-sample-entity.service.ts index 3ebb8df2..088bbf00 100644 --- a/api/src/nlp/services/nlp-sample-entity.service.ts +++ b/api/src/nlp/services/nlp-sample-entity.service.ts @@ -74,6 +74,6 @@ export class NlpSampleEntityService extends BaseService< } as NlpSampleEntity; }); - return this.createMany(sampleEntities); + return await this.createMany(sampleEntities); } } diff --git a/api/src/user/controllers/user.controller.ts b/api/src/user/controllers/user.controller.ts index 2a4594b5..a07b257a 100644 --- a/api/src/user/controllers/user.controller.ts +++ b/api/src/user/controllers/user.controller.ts @@ -84,7 +84,7 @@ export class ReadOnlyUserController extends BaseController< @Roles('public') @Get('bot/profile_pic') async botProfilePic(@Query('color') color: string) { - return getBotAvatar(color); + return await getBotAvatar(color); } /** @@ -103,7 +103,7 @@ export class ReadOnlyUserController extends BaseController< } catch (e) { const user = await this.userService.findOne(id); if (user) { - return generateInitialsAvatar(user); + return await generateInitialsAvatar(user); } else { throw new NotFoundException(`user with ID ${id} not found`); } diff --git a/api/src/user/services/passwordReset.service.ts b/api/src/user/services/passwordReset.service.ts index 845ddf52..704e1a9b 100644 --- a/api/src/user/services/passwordReset.service.ts +++ b/api/src/user/services/passwordReset.service.ts @@ -127,7 +127,7 @@ export class PasswordResetService { * @returns The signed JWT token. */ async sign(dto: UserRequestResetDto) { - return this.jwtService.signAsync(dto, this.jwtSignOptions); + return await this.jwtService.signAsync(dto, this.jwtSignOptions); } /** @@ -138,6 +138,6 @@ export class PasswordResetService { * @returns The decoded payload of the token. */ async verify(token: string): Promise { - return this.jwtService.verifyAsync(token, this.jwtSignOptions); + return await this.jwtService.verifyAsync(token, this.jwtSignOptions); } } diff --git a/api/src/user/services/validate-account.service.ts b/api/src/user/services/validate-account.service.ts index 3516e827..c7a7d203 100644 --- a/api/src/user/services/validate-account.service.ts +++ b/api/src/user/services/validate-account.service.ts @@ -50,7 +50,7 @@ export class ValidateAccountService { * @returns A promise that resolves to the signed JWT token. */ async sign(dto: { email: string }) { - return this.jwtService.signAsync(dto, this.jwtSignOptions); + return await this.jwtService.signAsync(dto, this.jwtSignOptions); } /** @@ -61,7 +61,7 @@ export class ValidateAccountService { * @returns A promise that resolves to an object containing the user's email. */ async verify(token: string): Promise<{ email: string }> { - return this.jwtService.verifyAsync(token, this.jwtSignOptions); + return await this.jwtService.verifyAsync(token, this.jwtSignOptions); } /** diff --git a/frontend/src/websocket/SocketIoClient.ts b/frontend/src/websocket/SocketIoClient.ts index 9c40194d..1829d4cb 100644 --- a/frontend/src/websocket/SocketIoClient.ts +++ b/frontend/src/websocket/SocketIoClient.ts @@ -149,7 +149,7 @@ export class SocketIoClient { url: string, options?: Partial>, ): Promise> { - return this.request({ + return await this.request({ method: "get", url, ...options, diff --git a/widget/src/utils/SocketIoClient.ts b/widget/src/utils/SocketIoClient.ts index 13b6d93a..a260f0ab 100644 --- a/widget/src/utils/SocketIoClient.ts +++ b/widget/src/utils/SocketIoClient.ts @@ -167,7 +167,7 @@ export class SocketIoClient { url: string, options?: Partial>, ): Promise> { - return this.request({ + return await this.request({ method: "get", url, ...options, @@ -178,7 +178,7 @@ export class SocketIoClient { url: string, options: Partial>, ): Promise> { - return this.request({ + return await this.request({ method: "post", url, ...options,