mirror of
https://github.com/hexastack/hexabot
synced 2025-04-10 15:55:55 +00:00
fix: add missing await
This commit is contained in:
parent
62e59069dd
commit
afa8364996
@ -153,7 +153,7 @@ export class AttachmentController extends BaseController<Attachment> {
|
||||
throw new NotFoundException('Attachment not found');
|
||||
}
|
||||
|
||||
return this.attachmentService.download(attachment);
|
||||
return await this.attachmentService.download(attachment);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -137,7 +137,7 @@ export class TranslationController extends BaseController<Translation> {
|
||||
);
|
||||
await Promise.all(queue);
|
||||
// Purge non existing translations
|
||||
return this.translationService.deleteMany({
|
||||
return await this.translationService.deleteMany({
|
||||
str: { $nin: strings },
|
||||
});
|
||||
}
|
||||
|
@ -74,6 +74,6 @@ export class NlpSampleEntityService extends BaseService<
|
||||
} as NlpSampleEntity;
|
||||
});
|
||||
|
||||
return this.createMany(sampleEntities);
|
||||
return await this.createMany(sampleEntities);
|
||||
}
|
||||
}
|
||||
|
@ -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`);
|
||||
}
|
||||
|
@ -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<UserRequestResetDto> {
|
||||
return this.jwtService.verifyAsync(token, this.jwtSignOptions);
|
||||
return await this.jwtService.verifyAsync(token, this.jwtSignOptions);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,7 +149,7 @@ export class SocketIoClient {
|
||||
url: string,
|
||||
options?: Partial<Omit<IOOutgoingMessage, "url" | "method" | "data">>,
|
||||
): Promise<IOIncomingMessage<T>> {
|
||||
return this.request({
|
||||
return await this.request({
|
||||
method: "get",
|
||||
url,
|
||||
...options,
|
||||
|
@ -167,7 +167,7 @@ export class SocketIoClient {
|
||||
url: string,
|
||||
options?: Partial<Omit<IOOutgoingMessage, "url" | "method" | "body">>,
|
||||
): Promise<IOIncomingMessage<T>> {
|
||||
return this.request({
|
||||
return await this.request({
|
||||
method: "get",
|
||||
url,
|
||||
...options,
|
||||
@ -178,7 +178,7 @@ export class SocketIoClient {
|
||||
url: string,
|
||||
options: Partial<Omit<IOOutgoingMessage, "url" | "method">>,
|
||||
): Promise<IOIncomingMessage<T>> {
|
||||
return this.request({
|
||||
return await this.request({
|
||||
method: "post",
|
||||
url,
|
||||
...options,
|
||||
|
Loading…
Reference in New Issue
Block a user