Merge pull request #1110 from Hexastack/1109-issue---onevent-methods-remove-unused-returns

fix(api): remove unused returns
This commit is contained in:
Med Marrouchi 2025-06-11 09:59:55 +01:00 committed by GitHub
commit 4f59fbaeb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 9 deletions

View File

@ -126,10 +126,10 @@ export default abstract class BaseWebChannelHandler<
try {
const menu = await this.menuService.getTree();
return client.emit('settings', { menu, ...settings });
client.emit('settings', { menu, ...settings });
} catch (err) {
this.logger.warn('Unable to retrieve menu ', err);
return client.emit('settings', settings);
client.emit('settings', settings);
}
} catch (err) {
this.logger.error('Unable to initiate websocket connection', err);

View File

@ -65,7 +65,6 @@ export class NlpService {
* Handles the event triggered when a new NLP entity is created. Synchronizes the entity with the external NLP provider.
*
* @param entity - The NLP entity to be created.
* @returns The updated entity after synchronization.
*/
@OnEvent('hook:nlpEntity:create')
async handleEntityCreate(entity: NlpEntityDocument) {
@ -74,7 +73,7 @@ export class NlpService {
const helper = await this.helperService.getDefaultHelper(HelperType.NLU);
const foreignId = await helper.addEntity(entity);
this.logger.debug('New entity successfully synced!', foreignId);
return await this.nlpEntityService.updateOne(
await this.nlpEntityService.updateOne(
{ _id: entity._id },
{
foreign_id: foreignId,
@ -82,7 +81,6 @@ export class NlpService {
);
} catch (err) {
this.logger.error('Unable to sync a new entity', err);
return entity;
}
}
@ -129,8 +127,6 @@ export class NlpService {
* Handles the event triggered when a new NLP value is created. Synchronizes the value with the external NLP provider.
*
* @param value - The NLP value to be created.
*
* @returns The updated value after synchronization.
*/
@OnEvent('hook:nlpValue:create')
async handleValueCreate(value: NlpValueDocument) {
@ -139,7 +135,7 @@ export class NlpService {
const helper = await this.helperService.getDefaultNluHelper();
const foreignId = await helper.addValue(value);
this.logger.debug('New value successfully synced!', foreignId);
return await this.nlpValueService.updateOne(
await this.nlpValueService.updateOne(
{ _id: value._id },
{
foreign_id: foreignId,
@ -147,7 +143,6 @@ export class NlpService {
);
} catch (err) {
this.logger.error('Unable to sync a new value', err);
return value;
}
}