mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +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');
|
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)
|
@CsrfCheck(true)
|
||||||
@Patch(':id')
|
@Patch(':id')
|
||||||
async updateOne(@Body() body: MenuCreateDto, @Param('id') id: string) {
|
async updateOne(@Body() body: MenuCreateDto, @Param('id') id: string) {
|
||||||
if (!id) return this.create(body);
|
if (!id) return await this.create(body);
|
||||||
return this.menuService.updateOne(id, 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.
|
* @returns A promise that resolves to the matching content documents.
|
||||||
*/
|
*/
|
||||||
async textSearch(query: string) {
|
async textSearch(query: string) {
|
||||||
return this.find({
|
return await this.find({
|
||||||
$text: {
|
$text: {
|
||||||
$search: query,
|
$search: query,
|
||||||
$diacriticSensitive: false,
|
$diacriticSensitive: false,
|
||||||
|
@ -49,7 +49,7 @@ export class ContentService extends BaseService<
|
|||||||
* @return A list of content matching the search query.
|
* @return A list of content matching the search query.
|
||||||
*/
|
*/
|
||||||
async textSearch(query: string) {
|
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) {
|
} catch (err) {
|
||||||
this.logger.error('Core NLU Helper : Unable to parse nlp', err);
|
this.logger.error('Core NLU Helper : Unable to parse nlp', err);
|
||||||
throw err;
|
throw err;
|
||||||
|
@ -137,7 +137,7 @@ export class TranslationController extends BaseController<Translation> {
|
|||||||
);
|
);
|
||||||
await Promise.all(queue);
|
await Promise.all(queue);
|
||||||
// Purge non existing translations
|
// Purge non existing translations
|
||||||
return this.translationService.deleteMany({
|
return await this.translationService.deleteMany({
|
||||||
str: { $nin: strings },
|
str: { $nin: strings },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,6 @@ export class NlpSampleEntityService extends BaseService<
|
|||||||
} as NlpSampleEntity;
|
} as NlpSampleEntity;
|
||||||
});
|
});
|
||||||
|
|
||||||
return this.createMany(sampleEntities);
|
return await this.createMany(sampleEntities);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ export class ReadOnlyUserController extends BaseController<
|
|||||||
@Roles('public')
|
@Roles('public')
|
||||||
@Get('bot/profile_pic')
|
@Get('bot/profile_pic')
|
||||||
async botProfilePic(@Query('color') color: string) {
|
async botProfilePic(@Query('color') color: string) {
|
||||||
return getBotAvatar(color);
|
return await getBotAvatar(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,7 +103,7 @@ export class ReadOnlyUserController extends BaseController<
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
const user = await this.userService.findOne(id);
|
const user = await this.userService.findOne(id);
|
||||||
if (user) {
|
if (user) {
|
||||||
return generateInitialsAvatar(user);
|
return await generateInitialsAvatar(user);
|
||||||
} else {
|
} else {
|
||||||
throw new NotFoundException(`user with ID ${id} not found`);
|
throw new NotFoundException(`user with ID ${id} not found`);
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ export class PasswordResetService {
|
|||||||
* @returns The signed JWT token.
|
* @returns The signed JWT token.
|
||||||
*/
|
*/
|
||||||
async sign(dto: UserRequestResetDto) {
|
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.
|
* @returns The decoded payload of the token.
|
||||||
*/
|
*/
|
||||||
async verify(token: string): Promise<UserRequestResetDto> {
|
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.
|
* @returns A promise that resolves to the signed JWT token.
|
||||||
*/
|
*/
|
||||||
async sign(dto: { email: string }) {
|
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.
|
* @returns A promise that resolves to an object containing the user's email.
|
||||||
*/
|
*/
|
||||||
async verify(token: string): Promise<{ email: string }> {
|
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,
|
url: string,
|
||||||
options?: Partial<Omit<IOOutgoingMessage, "url" | "method" | "data">>,
|
options?: Partial<Omit<IOOutgoingMessage, "url" | "method" | "data">>,
|
||||||
): Promise<IOIncomingMessage<T>> {
|
): Promise<IOIncomingMessage<T>> {
|
||||||
return this.request({
|
return await this.request({
|
||||||
method: "get",
|
method: "get",
|
||||||
url,
|
url,
|
||||||
...options,
|
...options,
|
||||||
|
@ -167,7 +167,7 @@ export class SocketIoClient {
|
|||||||
url: string,
|
url: string,
|
||||||
options?: Partial<Omit<IOOutgoingMessage, "url" | "method" | "body">>,
|
options?: Partial<Omit<IOOutgoingMessage, "url" | "method" | "body">>,
|
||||||
): Promise<IOIncomingMessage<T>> {
|
): Promise<IOIncomingMessage<T>> {
|
||||||
return this.request({
|
return await this.request({
|
||||||
method: "get",
|
method: "get",
|
||||||
url,
|
url,
|
||||||
...options,
|
...options,
|
||||||
@ -178,7 +178,7 @@ export class SocketIoClient {
|
|||||||
url: string,
|
url: string,
|
||||||
options: Partial<Omit<IOOutgoingMessage, "url" | "method">>,
|
options: Partial<Omit<IOOutgoingMessage, "url" | "method">>,
|
||||||
): Promise<IOIncomingMessage<T>> {
|
): Promise<IOIncomingMessage<T>> {
|
||||||
return this.request({
|
return await this.request({
|
||||||
method: "post",
|
method: "post",
|
||||||
url,
|
url,
|
||||||
...options,
|
...options,
|
||||||
|
Loading…
Reference in New Issue
Block a user